0

i have problem in my sql query. my limit can not work properly. the displaying error is this. You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'LIMIT0, 10' at line 137 my function is this in which i call query

function getprofitinstructornoman($id,$start,$per_page)
{
     $select="select s.id,s.name,s.phone,s.email from smaccount s where s.manager_id='".$id."'LIMIT".$start.", ".$per_page;
        $res = $GLOBALS ['mysqli1']->query ($select) or die ($GLOBALS ['mysqli1']->error . __LINE__);
        if ($res->num_rows > 0)
        {return $res;}
        else{return false;}
}

please tell me where is the problem? and why my query is not working properly? thanks Mohsin

1 Answer 1

3

You are missing a space. Use this instead of your line of code.

$select="select s.id,s.name,s.phone,s.email from smaccount s
where s.manager_id='".$id."' LIMIT ".$start.", ".$per_page;

I've added an extra space before and after "LIMIT".

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.