PFMaBiSmAd Posted November 4, 2011 Share Posted November 4, 2011 You are calling the sanitiseMySQL function three times, on lines 22,23,and 24, in your posted code. You are making the mysqli connection in $conn on line 36 in your posted code. The line where you are making the database connection in $conn is after where you are calling the function that uses the connection in $conn, therefor the error you are getting - Warning: mysqli_real_escape_string() expects parameter 1 to be mysqli, null given Quote Link to comment https://forums.phpfreaks.com/topic/250289-inserting-values-via-php-to-sql-database/page/2/#findComment-1284877 Share on other sites More sharing options...
Veraedon Posted November 5, 2011 Author Share Posted November 5, 2011 Thanks very much for your advice. I'll make the changes then see how I go. It will be later this afternoon as I have work today, hence the tardiness of my replies, apologies. Quote Link to comment https://forums.phpfreaks.com/topic/250289-inserting-values-via-php-to-sql-database/page/2/#findComment-1285346 Share on other sites More sharing options...
Veraedon Posted November 6, 2011 Author Share Posted November 6, 2011 Got it all working now, thanks guys! Quote Link to comment https://forums.phpfreaks.com/topic/250289-inserting-values-via-php-to-sql-database/page/2/#findComment-1285499 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.