Friday 15 February 2013

mysql - Select 1 row from select statement php -



mysql - Select 1 row from select statement php -

$query = "select questionid, surveyid, question, responsetype, imageid questions surveyid = " . $_post['survey'] .";"; $result = $mysqli->query($query); $row = $result->fetch_array(3);

i'm trying 3rd row of select statement. lastly line didn't work , returns first line , i've been trying hr looking around stackoverflow , php website , can't find anything. there way this?

just utilize limit clause in sql statement:

$query = "select questionid, surveyid, question, responsetype, imageid questions surveyid = " . $_post['survey'] ." limit 2,1;";

the 2 means start @ 3rd row (remember start counting @ zero) , 1 means homecoming 1 row.

php mysql

No comments:

Post a Comment