Jump to content

I want to check a Table


Scorpion28

Recommended Posts

This is suppose to check a table to see if it has a value in it.  I get this error:

 

Warning: mysql_num_rows(): supplied argument is not a valid MySQL result resource in /homepages/6/d365637117/htdocs/EE Live/Active/Inc/session.php on line 33

 

 

This is the code

if($checkProfile)

{

    $result = mysql_query("SELECT prof_pic FROM members_profile WHERE id = '".$_SESSION['EEID']."'");

$mem_num_rows = mysql_num_rows($result);

if($mem_num_rows =1)

{

 

 

}

Link to comment
https://forums.phpfreaks.com/topic/253973-i-want-to-check-a-table/
Share on other sites

Your query is failing. Either you have not connected to the db properly or there is a typo in your query. Try using this to see what the error is

    $query = "SELECT prof_pic FROM members_profile WHERE id = '".$_SESSION['EEID']."'";
    $result = mysql_query($query) or die("Query: {$query}<br>Error: " . mysql_error());
    $mem_num_rows = mysql_num_rows($result);
    if($mem_num_rows =1

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.