Link to home
Start Free TrialLog in
Avatar of acenad
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

ASKER CERTIFIED SOLUTION
Avatar of xbite
xbite

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Too late cause of network issues. It dropped just when I want to send my answer.

Pyxos
Avatar of acenad
acenad

ASKER

Hello,

Thx xBite!!!

Kind Regards.