Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Query working on MySql Querier not on PHP

Status
Not open for further replies.

McKaulick

Programmer
Oct 24, 2002
35
0
0
AR
Can anyone tell me what in this query could create a PHP bug but good when I execute the query on SQL Yog.

Thanks all for your help.

$myQuery = "SELECT merchants.PK_MERCHANTS_UID AS bob,merchants.MERCHANTS_NAME as bob1,discounts.PK_DISCOUNTS_UID as bob2,discounts.DISCOUNTS_DESC as bob3 FROM merchants,discounts INNER JOIN merchants_discounts ON merchants.PK_MERCHANTS_UID = merchants_discounts.FK_MERCHANTS_UID and discounts.PK_DISCOUNTS_UID = merchants_discounts.FK_DISCOUNTS_UID GROUP BY merchants.PK_MERCHANTS_UID";

Warning: mysql_fetch_array(): supplied argument is not a valid MySQL result resource in c:\program files\easyphp1-8\ on line 354
 
Have you tried asking it why its not working:

Code:
mysql_query($myQuery) [red]or die(mysql_error())[/red];

Maybe then it will tell what problem its having with the query.

----------------------------------
Ignorance is not necessarily Bliss, case in point:
Unknown has caused an Unknown Error on Unknown and must be shutdown to prevent damage to Unknown.
 
Hello Vacunita,

It actually gives the same error message when I add the or die.

Any thoughts?

Thanks
 
try a bit further up in the connect or select_db functions.
 
Hey thanks guys for you help...

I found the problem, I am actually building the query in a function and I was just forgetting to return the result. :-s Thanks anyway... Soo tired, I better stop now.

Thanks :)
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top