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!