Jump to content

Query problems?


ChrisMartino

Recommended Posts

Hey i am trying to query my database and list in order of price descending but i get error with this:

 

$result = mysql_query("SELECT * FROM Packages WHERE `Name` = `IV-MP` ORDER BY Price DESC");

 

Error:

 

Warning: mysql_fetch_array(): supplied argument is not a valid MySQL result resource in /home3/chrismar/public_html/x-host.co.uk/packages.php on line 95

 

(The $result above is line 95)

 

Anyone got any idea's?, That looks fine to me :(

 

Thank you for your time!

Link to comment
https://forums.phpfreaks.com/topic/198559-query-problems/
Share on other sites

When you use `, it's to let MySQL know that you want it to represent a table name or a column name. For a value, you should use single quotes. Like 'IV-MP' not `IV-MP`.

 

Thanks your very helpful, You've solved every problem i have posted about xD

Link to comment
https://forums.phpfreaks.com/topic/198559-query-problems/#findComment-1041948
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.