|
Posted by Richard on 07/01/07 01:09
"masterx" <masterx@anonymous.org> wrote in message
news:138duk2642c7pf8@corp.supernews.com...
> 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.
Check the error message that is returned, that will give you (and us) more
clues....
Richard
Navigation:
[Reply to this message]
|