From: Caitlin H. <ca...@me...> - 2007-03-14 21:22:22
|
Hi-- I apologize for the off-topic post, but I know that there are a lot of PHP developers who are or have been Perl developers. My current employer is looking for someone with around 5-10 years of development experience, who wants to program in object oriented Perl, and who has a good understanding of relational databases and SQL. If you're interested, please email me at caitlin at caitlinhowell.com. Thanks, Caitlin |
From: Roderick T. <tho...@ms...> - 2007-03-15 12:51:58
|
$query=3D"SELECT CityID FROM Cities WHERE CityName =3D 'Ann Arbor, MI'";= print "hello"; print "$city_selection"; print "hello"; $result=3Dmysql_query($query); $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_selection'= "; = |
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 > |
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? |
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'"; > |