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

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]


Удаленная работа для программистов  •  Как заработать на 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

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