TapeGun007 Posted July 30, 2015 Share Posted July 30, 2015 I have a typical prepared mySQLi statement that runs just fine for example: ... $stmt = $con->prepare($sql); if($stmt === false){ trigger_error('Wrong SQL: ' . $sql . ' Error: ' . $con->error, E_USER_ERROR); } $stmt->bind_param("s",$Username); $stmt->execute(); $stmt->bind_result( ** Variables here** ); $stmt->fetch(); $stmt->close(); This all works fine. Now I want to make another mySQLi call using a function basically. The function works FINE in a test file with no other mySQLi calls in it. For sake of ease, just assume this was actually in the code after the above. $sql="INSERT INTO LoginAttempts (LASalesID) VALUES ('$ID')"; if ($con->query($sql) === TRUE) { echo "New record created successfully"; } else { // Report the Error echo "Error: " . $sql . "<br>" . mysqli_error($con); } I'm getting the Error message every time. Am I not closing out the initial calls correctly and freeing up resources? Link to comment https://forums.phpfreaks.com/topic/297549-multiple-mysqli-calls/ Share on other sites More sharing options...
Zane Posted July 30, 2015 Share Posted July 30, 2015 Probably because you are closing the connection before hand Link to comment https://forums.phpfreaks.com/topic/297549-multiple-mysqli-calls/#findComment-1517738 Share on other sites More sharing options...
TapeGun007 Posted July 30, 2015 Author Share Posted July 30, 2015 LOL. I can't believe it was that simple. Yeah, I had $con->close; in there. Link to comment https://forums.phpfreaks.com/topic/297549-multiple-mysqli-calls/#findComment-1517739 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.