MySQL failed successful queries?

wxdqz

New Member
Hey everehbodeh,

I'm a home php builder who has been upgraded to a work php builder... Luckily I'm just a grunt so I am blame-resistant - but I'd appreciate it if anyone could help me out with this little prob I'm having...

We got a Red Hat Linux/apache/php/mysql setup running here and I've been working a long time on a certain project... Now when I'm nearing the end something has to pop up - which is this:

$query = "'SELECT * FROM katalog WHERE id=$id AND pjnr=$pjnr AND type<>'TT' AND type<>'QA' AND type<>'EA''";
$content2 = mysql_result($query,0,"content");

This query (where $id is 1 and $pjnr is 1) simply will not work in PHP - but it WILL work in Phpmyadmin... What I mean is - when I enter this query in the query window provided by PHPmyadmin it all works out and I get 1 row - but if I attempt the same thing in PHP I get:

Warning: Supplied argument is not a valid MySQL result resource in /var/www/html/test.php on line 15

Why? I cannot figure out... I've isolated this query into a single file to rule out outside influences and I've replaced the vars with actual numbers... Same @!#$ every time :( Maybe such a long query needs to be set in special brackets or something? Please help! :D

Thanks,

Gazoo...
 
Back
Top