Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7884701
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 3, 20262026-06-03T04:52:16+00:00 2026-06-03T04:52:16+00:00

my problem is this i am fetching a mysql row via this $sql_istorrenthere =

  • 0

my problem is this

i am fetching a mysql row via this

                $sql_istorrenthere = $this->query_silent("SELECT media_type
FROM " . DB_PREFIX . "auction_media WHERE
                auction_id='" . $item_details['auction_id'] . "'"); 
$row = mysql_fetch_array($sql_istorrenthere);

and then calling it with this

if ($row['media_type'] == 4) 
{

        $display_output = GMSG_TORRENT;}
        else
        {
        $display_output = GMSG_NOTORRENT;
        }
}

however, media_type has multiple values, (1,2,3,4)
how to write it so that it checks if 4 exists? because now i believe it is checking if media_type equals 4 and that is false, which is giving me the wrong display_output

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-03T04:52:18+00:00Added an answer on June 3, 2026 at 4:52 am

    You can use mysql_num_rows to determine if any rows were returned, and this works by adding a search condition in your query adding ” AND media_type = 4″ to the end

    if(mysql_num_rows($sql_istorrenthere)) {
    
    } else {
    
    }
    
    // You can loop through records by doing the following, this prints out every media type :)
    while ($row = mysql_fetch_array($sql_istorrenthere)) {
        echo $row['media_type'] . '<br />';
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

This problem is baffling me: BEGIN; INSERT INTO sub_users(user_id, email) SELECT user_id FROM users
Hello I have a problem with fetching required rows from MySQL table correctly within
My application is fetching a data dynamically from MYSQL and displaying. The Problem is
I have a problem fetching values from a MySQL cursor. I create a temporary
Hi im trying to solve this problem, I'm fetching data from DB and create
i have another problem this time, i'm fetching json codes that will be used
I'm struggling on this problem. The body I am fetching is not a big
I've a problem with this linq to nhibernate query var listeShopping = (from cart
I have an problem in fetching records from database with php. I have 31700
I having trouble cause I am fetching some text from the db(mysql), that text

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.