| 
 Posted by Jeff North on 02/27/07 06:51 
On 26 Feb 2007 21:31:38 -0800, in comp.lang.php "Abersparky" 
<abersparky@gmail.com> 
<1172554298.603800.62920@k78g2000cwa.googlegroups.com> wrote: 
 
>| Can anyone help me out here... 
>|  
>| I can't quite seem to get this right.  I have a table of which I need 
>| to extract data based on two fields: entry_id and vis.  The below 
>| results in error.  When I remove the second condition from the WHERE 
>| statement, it counts the entry id as "comnumrows". 
>|  
>| Is my SELECT statement wrong??? 
>|  
>| 	$comvis = "N"; 
>| 	$comquery = mysql_query("SELECT * FROM comments WHERE (entry_id = 
>| $id  AND vis = $comvis)"); 
            vis = '$comvis')"); 
because the variable is a string/char 
 
>| 	$comquery_data = mysql_fetch_row($comquery ); 
>| 	$comnumrows = $comquery_data[0]; 
>| 	print $comnumrows . " comments"; 
--------------------------------------------------------------- 
jnorthau@yourpantsyahoo.com.au  : Remove your pants to reply 
---------------------------------------------------------------
 
  
Navigation:
[Reply to this message] 
 |