timekiller11 Posted May 10, 2011 Share Posted May 10, 2011 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(); Quote Link to comment https://forums.phpfreaks.com/topic/236033-function-called-on-a-non-object/ Share on other sites More sharing options...
fugix Posted May 10, 2011 Share Posted May 10, 2011 what version of php are you using Quote Link to comment https://forums.phpfreaks.com/topic/236033-function-called-on-a-non-object/#findComment-1213441 Share on other sites More sharing options...
fugix Posted May 10, 2011 Share Posted May 10, 2011 read this thread here they talk about your issue...comment #26 provides a solution Quote Link to comment https://forums.phpfreaks.com/topic/236033-function-called-on-a-non-object/#findComment-1213443 Share on other sites More sharing options...
timekiller11 Posted May 10, 2011 Author Share Posted May 10, 2011 what version of php are you using PHP Version 5.2.6 read this thread here they talk about your issue...comment #26 provides a solution i already found that thread, but i don't get it. also, i don't use a global DB. Quote Link to comment https://forums.phpfreaks.com/topic/236033-function-called-on-a-non-object/#findComment-1213447 Share on other sites More sharing options...
timekiller11 Posted May 10, 2011 Author Share Posted May 10, 2011 Found my error, on the creation of the BD i had a typo in a field name... still... Tks fugix for fast answer Quote Link to comment https://forums.phpfreaks.com/topic/236033-function-called-on-a-non-object/#findComment-1213457 Share on other sites More sharing options...
fugix Posted May 10, 2011 Share Posted May 10, 2011 no problem, sorry i couldn't be of more help Quote Link to comment https://forums.phpfreaks.com/topic/236033-function-called-on-a-non-object/#findComment-1213458 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.