Jump to content

Archived

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

darkangel220

**solved** PHP Code WHERE cause dose not work

Recommended Posts

I've been having a bit of a problem with getting some information from the mysql database.
The problem I wanted to solve was to have all the information that containted the word Amature in the rank colom to only be displayed.

This part of the script.

$sql = 'SELECT * FROM `Cooking_guild` WHERE `rank`=Amateur ORDER BY `lvl_cap` ASC ';

For some resion it comes up with this error:
Unknown column 'Amateur' in 'where clause'

But if I replace the word with a number like 500 there is no error at all, but cause I wanted all the amaterur rank info displayed and since 500 is not even a rank it dose not work.

Where am I going wrong here?

Share this post


Link to post
Share on other sites
your listing your columns wrong

try this

[code]
$sql = "SELECT * FROM Cooking_guild WHERE rank='Amateur' ORDER BY lvl_cap ASC ";

ect..
[/code]

Share this post


Link to post
Share on other sites
Thank you so much for this.

I've been out of php for a good year, so I'm kind of new again.

This has solved my headace.

/bow

Share this post


Link to post
Share on other sites

×

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.