From: Richard L. <ce...@l-...> - 2007-03-15 18:19:40
|
On Thu, March 15, 2007 7:51 am, Roderick Thomas wrote: > $query="SELECT CityID FROM Cities WHERE CityName = '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=mysql_query($query); Humor me, and add: or die(mysql_error()); at the end of that line. > $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'"; -- Some people have a "gift" link here. Know what I want? I want you to buy a CD from some starving artist. http://cdbaby.com/browse/from/lynch Yeah, I get a buck. So? |