Page 1 of 1

[SOLVED] mysql query works but php code for query doesnt

Posted: Wed Feb 02, 2005 9:53 am
by tazdog
I have a Select\Where query I'm trying to run and display on a web page, pretty simple, exept the fact is I'm missing something and it's not working..

If I put the following into a sql query on phpmyadmin it works:

Code: Select all

SELECT * FROM `destinations` WHERE `Destination_ID` = 'Domestic'
But when I try to add this to php it breaks.

Code: Select all

$query = "SELECT * FROM destinations WHERE DestinationID='Domestic'";
I'm fairly new to all of this but I've been trying things and searching since yesterday afternoon trying to figure this one out..

Thanks
Scott

Re: mysql query works but php code for query doesnt

Posted: Wed Feb 02, 2005 9:58 am
by timvw
tazdog wrote:
If I put the following into a sql query on phpmyadmin it works:

Code: Select all

SELECT * FROM `destinations` WHERE `Destination_ID` = 'Domestic'
But when I try to add this to php it breaks.

Code: Select all

$query = "SELECT * FROM destinations WHERE DestinationID='Domestic'";
the second query is missing a _ between Destination and ID.

Posted: Wed Feb 02, 2005 10:34 am
by tazdog
I'm a dumb a*s.. :?

thanks for pointing that out.!!! :)