Query Not Executing Correctly

Need help installing PHP, configuring a script, or configuring a server? Then come on in and post your questions! We'll try to help the best we can!

Moderator: General Moderators

Locked
Harlequin
Forum Commoner
Posts: 51
Joined: Tue Sep 21, 2004 10:51 am
Location: UK

Query Not Executing Correctly

Post by Harlequin »

Morning all.

I've looked at this until I'm blue in the face and for some reason can't see the problem.

My query returns an error saying it is empty but I know the values exist in the table. Can anyone see what I'm missing...?

Code: Select all

$Query = mysql_query("SELECT * FROM events
   WHERE EventCode == 'PMJ';
   ORDER BY EventTime DESC");
   $Data = mysql_query($Query) or die("Error: " . mysql_error());
   while($row = mysql_fetch_array($Query))
Thanks for taking a look.
timvw
DevNet Master
Posts: 4897
Joined: Mon Jan 19, 2004 11:11 pm
Location: Leuven, Belgium

Post by timvw »

compare operator in SQL is "=" not "=="
User avatar
phpScott
DevNet Resident
Posts: 1206
Joined: Wed Oct 09, 2002 6:51 pm
Location: Keele, U.K.

wrong forum

Post by phpScott »

this was posted in the wrong forum but I see that you did post in the correct forum.
the mod's will notice.
It is possible to delete your post if you view it and you are the owner or the post.

posted answer in other forum
User avatar
feyd
Neighborhood Spidermoddy
Posts: 31559
Joined: Mon Mar 29, 2004 3:24 pm
Location: Bothell, Washington, USA

Post by feyd »

no cross posting.

original thread: viewtopic.php?t=26197
Locked