acenad
asked on
MySql Select Statement in PHP
Hello,
In ASP when I do a select statement I could specify the number of rows I want, e.g. "Select Top 5 from aTable". Then I executed the query.
But in MySql this statement is not valid (TOP 5). The statement below (in PHP):
$result = mysql_query ("SELECT Top 5 FROM $table") or die ("Invalid query");
generates the error message "invalid query".
My Question:
How can I select some rows only (say 5) instead of the whole recordset???
Thanks,
nad
In ASP when I do a select statement I could specify the number of rows I want, e.g. "Select Top 5 from aTable". Then I executed the query.
But in MySql this statement is not valid (TOP 5). The statement below (in PHP):
$result = mysql_query ("SELECT Top 5 FROM $table") or die ("Invalid query");
generates the error message "invalid query".
My Question:
How can I select some rows only (say 5) instead of the whole recordset???
Thanks,
nad
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
Hello,
Thx xBite!!!
Kind Regards.
Thx xBite!!!
Kind Regards.
Pyxos