Page 1 of 1

MySQL Limit

Posted: Sun Mar 12, 2006 1:12 pm
by Qaid
Hi,

I have this code:

Code: Select all

$sql = mysql_query("SELECT * FROM table");


Inside this Mysql db I have multiple data, one row is called "category". In the category row I have different values, like 'Toys', 'Games' etc..

Is it possible to only get the row with data containing 'Games'? And how do i do it?

Thanks!

Posted: Sun Mar 12, 2006 1:13 pm
by feyd
can you post an export of the table's structure and some example records?

Posted: Sun Mar 12, 2006 1:23 pm
by Qaid
Can't find out hte exporting stuff,

But i have these Tables: id, title, category, description and prize.

Some examples could be...
id - title - category - description - prize

1 Grape Fruit ... 2.99
2 Football Games ... 5.99
3 Apple Fruit ... 9.99

Etc, etc...

If is it possible to post only those containing Fruit from the category and sort them by id so number 1 come first?

Thanks againg..

Posted: Sun Mar 12, 2006 1:26 pm
by s.dot

Code: Select all

$sql = "SELECT * FROM `table` WHERE `category` = 'Fruit' ORDER BY `id` ASC";

Posted: Sun Mar 12, 2006 1:51 pm
by Qaid
Thank you guys very much :)