Many people on stackoverflow has had this problem, but i still cannot spot the mistake
This is the error:
Fatal error: Call to a member function bind_param() on boolean -
This is the lines of code:
$insertpost = $conn->prepare("INSERT INTO posts (title,post,user,img,date,short) VALUES(?,?,?,?,NOW(),?)");
$insertpost->bind_param("sssss",$title,$comment,$user,$url,$short);
$insertpostmight be boolfalse, probably because theprepare()fails."sssss", looking at your parameters, you seem to have types other than the ones you are defining. I can at least see possible: date/datetime and integer types. It's just a suggestion, they may be implicit conversions, but I usually prefer to type things correctly regardless of if they have implicit conversions, just to be safe.$insertpostcontains false If you test for this situation ALWAYS you wont get this problem. Aso use$conn->errorto see a description of the error if$insertpost === false