You are here: Multiple WHERE statements and numrows() « PHP Programming Language « IT news, forums, messages
Multiple WHERE statements and numrows()

Posted by Abersparky on 02/27/07 05:31

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)");
$comquery_data = mysql_fetch_row($comquery );
$comnumrows = $comquery_data[0];
print $comnumrows . " comments";

 

Navigation:

[Reply to this message]


Удаленная работа для программистов  •  Как заработать на Google AdSense  •  England, UK  •  статьи на английском  •  PHP MySQL CMS Apache Oscommerce  •  Online Business Knowledge Base  •  DVD MP3 AVI MP4 players codecs conversion help
Home  •  Search  •  Site Map  •  Set as Homepage  •  Add to Favourites

Copyright © 2005-2006 Powered by Custom PHP Programming

Сайт изготовлен в Студии Валентина Петручека
изготовление и поддержка веб-сайтов, разработка программного обеспечения, поисковая оптимизация