• Howdy! Welcome to our community of more than 130.000 members devoted to web hosting. This is a great place to get special offers from web hosts and post your own requests or ads. To start posting sign up here. Cheers! /Peo, FreeWebSpace.net
managed wordpress hosting

Weird mySQL query problem

ashben

Moderator
I have this SQL query :

select A.Name, B.Age from A inner join B on A.ID=B.ID

.. on two MySQL DB tables namely A and B. But it results in a "Warning: Supplied argument is not a valid MySQL result resource in ... " message under PHP. I'm running mySQL 3.23 and yes, both the join condition parameters (A.ID & B.ID) are of the same data type (i.e. MediumInt(11)-Unsigned).

What's wrong with the above SQL query syntax or the join itself.

Any help is appreciated!
 
Thanks atlas. Giving away the JOIN and using the WHERE condition helped. But could you (or anyone) please tell me why doesnt the JOIN thing work & secondly is the WHERE condition as efficient as a JOIN in this case.

Any help is appreciated!
 
What version of mySQL do you have running? Versions previous to 3.23.16 didn't allow INNER JOIN to take any conditions like 'on.'

Otherwise your syntax is correct. I just use the where clause since it's easier for basic table joins -- I have no idea about the efficiency.

Hope this helps

mjk@atlascgi.com
 
Back
Top