From: Roderick T. <tho...@ms...> - 2007-03-15 18:21:57
|
That was the problem. On Thu, 15 Mar 2007 14:19:25 -0400, Richard Lynch <ce...@l-...> wrote:= > On Thu, March 15, 2007 7:51 am, Roderick Thomas wrote: >> $query=3D"SELECT CityID FROM Cities WHERE CityName =3D 'Ann Arbor, MI= '"; >> >> print "hello"; > > Perhaps your input has some white space before or after the city name.= .. > > It's a Goog Idea to add some apostrophes or other marks around your > dynamic debug output so you know if there is whitespace included in > the data. > >> print "$city_selection"; > > print "<br />\n'$city_selection'<br />\n"; > >> print "hello"; >> >> $result=3Dmysql_query($query); > > Humor me, and add: > or die(mysql_error()); > at the end of that line. > >> $num=3Dmysql_numrows($result); >> $i=3D0; >> >> while ($i < $num) >> { >> global $CityID; >> $CityID=3Dmysql_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=3D"SELECT CityID FROM Cities WHERE CityName =3D '$city_selecti= on'"; > |