0

I am urgently seeking assistance with the following error:
Commands out of sync; you can't run this command now

here's the code:

$sql="select pr1.".$_SESSION['lang'].", pr1.id, pr2.".$_SESSION['lang'].", pr2.id from `project` as pr2 join project as `pr1` on(pr1.id=pr2.parent_project) where pr2.id=?";
        $stmt = $mysqli->stmt_init();   
        $stmt->prepare($sql) or die ("Error preparing statement: ".$mysqli->error);
        $stmt->bind_param('i',$_GET['id']); 
        $stmt->execute() or die("Error, error, error!");
    $stmt->bind_result($group,$group_id,$project,$project_id);

I have tied non prepared statements (they work...) and have even changed the sql to something simple without binding parameters, but as soon as I get to the ececute statement the error is triggered.

Thanks in advance!

3
Contributors
2
Replies
5
Views
5 Years
Discussion Span
Last Post by cereal
This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.