From: Anacreo <an...@gm...> - 2007-03-15 13:30:13
|
Why don't you eliminate some of your confusion and just print out the $query value with both versions? ... $result=mysql_query($query); echo "QUERY: $query\nRESULT: $result\n"; ... Alec On 3/15/07, Roderick Thomas <tho...@ms...> wrote: > > $query="SELECT CityID FROM Cities WHERE CityName = 'Ann Arbor, MI'"; > > print "hello"; > print "$city_selection"; > print "hello"; > > $result=mysql_query($query); > $num=mysql_numrows($result); > $i=0; > > while ($i < $num) > { > global $CityID; > $CityID=mysql_result($result,$i, "CityID"); > $i++; > print "$CityID"; > } > > The above script gives me this output: > helloAnn Arbor, MIhello1 > > Yet, the CityID doesn't show up when I use this query: > $query="SELECT CityID FROM Cities WHERE CityName = '$city_selection'"; > > > > ------------------------------------------------------------------------- > Take Surveys. Earn Cash. Influence the Future of IT > Join SourceForge.net's Techsay panel and you'll get the chance to share > your > opinions on IT & business topics through brief surveys-and earn cash > http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV > _______________________________________________ > chiPHPug-discuss mailing list > chi...@li... > https://lists.sourceforge.net/lists/listinfo/chiphpug-discuss > |