Jump to content

Function called on a non-object


timekiller11

Recommended Posts

ERROR 0 Fatal error: Call to a member function execute() on a non-object ...

 

i've tested the $mysqli and $stmt, both are objects, i have other requests that work well and are built the same way (copy - paste)

 

all vars on the query are also ok.

 

There are working functions over and under this part of my code, if i remove it everything works fine.

 


$query2 = "INSERT INTO TABLE_NAME(accountSmtp, passwordSmtp, merchantID, adsPrice, adsWidth, adsHeigh, adsAmount, email, emailFrom, adsSense) VALUES('$gmailUser', '$gmailPassword', '$merchantID', '$prix', '$width', '$height', '$adsAmount', '$email', '$from', '$sense')";
if (!$stmt = $mysqli->prepare($query2)) {
	printf("Erreur : %d.\n", $stmt->errno);
	print_r($query2);
}

/* execute statement */
$stmt->execute();


//close statement 
$stmt->close();

Link to comment
https://forums.phpfreaks.com/topic/236033-function-called-on-a-non-object/
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.