Syntax Question

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
User avatar
psurrena
Forum Contributor
Posts: 355
Joined: Thu Nov 10, 2005 12:31 pm
Location: Broolyn, NY

Syntax Question

Post by psurrena »

Can someone help me with this?

Code: Select all

$query = "SELECT * FROM workshop WHERE type = Workshop ORDER BY id  ASC LIMIT $offset, $rowsPerPage";
The problem is "WHERE type = Workshop". I get the error "Error : Unknown column 'Workshop' in 'where clause'". The row is called "type" and the value is "workshop".

Thanks
programmermatt
Forum Commoner
Posts: 65
Joined: Tue Mar 15, 2005 5:03 pm
Contact:

Re: Syntax Question

Post by programmermatt »

I think you want:

Code: Select all

$query = "SELECT * FROM workshop WHERE type = 'Workshop' ORDER BY id  ASC LIMIT $offset, $rowsPerPage";
User avatar
psurrena
Forum Contributor
Posts: 355
Joined: Thu Nov 10, 2005 12:31 pm
Location: Broolyn, NY

Post by psurrena »

Thanks. Works perfect!
Post Reply