Posted by masterx on 07/01/07 00:52
Hey guys, I'm having issues with some MySQL code in PHP. I'm running
MySQL-nt 3.23.38, PHP 4.4.1 and Apache 2.0.55 under Windows XP SP2. I'm
just running these as my local development platform.
I've been using this DB for some time now without any problems, until
recently when I needed to add a couple of new tables. I've added the
tables fine (they are the same type as all the other tables in the DB)
but I can not select the new tables in PHP. It's the exact same code
I've used to fetch data from the older tables but it just won't do it
for the new tables... I'm pulling my hair out. ;-)
Examples...
//old (working) code:
$query = "SELECT * FROM brokers";
$result = mysql_query($query);
$num_rows = mysql_num_rows($result);
//new code:
$query = "SELECT * FROM locations";
$result = mysql_query($query);
$num_rows = mysql_num_rows($result);
I've also tried
$result = mysql_query("SELECT * FROM cities");
instead of using $query var, same result. The new query returns false
for some reason. What makes me think it's a PHP problem is that I can
run MySQLFront and run the exact same query just fine and fetch the
data, it all seems to work fine outside of PHP. Is my version of PHP a
little screwy? Maybe needs updating? Any ideas?
Thanks.
[Back to original message]
|