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

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
tazdog
Forum Newbie
Posts: 10
Joined: Tue Aug 10, 2004 4:50 pm
Location: Grand Prarie, TX
Contact:

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

Post 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
timvw
DevNet Master
Posts: 4897
Joined: Mon Jan 19, 2004 11:11 pm
Location: Leuven, Belgium

Re: mysql query works but php code for query doesnt

Post 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.
tazdog
Forum Newbie
Posts: 10
Joined: Tue Aug 10, 2004 4:50 pm
Location: Grand Prarie, TX
Contact:

Post by tazdog »

I'm a dumb a*s.. :?

thanks for pointing that out.!!! :)
Post Reply