Barand Posted January 10, 2020 Share Posted January 10, 2020 Easiest way is to add this line to your included connection.php mysqli_report(MYSQLI_REPORT_ERROR|MYSQLI_REPORT_STRICT); immediately before the line that connects to the database (either with mysqli_connect() or new mysqli() ) Quote Link to comment https://forums.phpfreaks.com/topic/309817-im-facing-database-submission-issues/page/2/#findComment-1573285 Share on other sites More sharing options...
gw1500se Posted January 10, 2020 Share Posted January 10, 2020 No, you are the programmer. If you want someone to write the program for you there is a form to hire someone. Quote Link to comment https://forums.phpfreaks.com/topic/309817-im-facing-database-submission-issues/page/2/#findComment-1573286 Share on other sites More sharing options...
Frankice Posted January 10, 2020 Author Share Posted January 10, 2020 Just now, Barand said: Easiest way is to add this line to your included connection.php mysqli_report(MYSQLI_REPORT_ERROR|MYSQLI_REPORT_STRICT); immediately before the line that connects to the database (either with mysqli_connect() or new mysqli() ) I understand your point on the hiring aspect. Here is my connection Sir, <?php // database connection config $dbHost = 'localhost'; $dbUser = ''; $dbPass = ''; $dbName = ''; $dbConn = mysqli_connect ($dbHost, $dbUser, $dbPass) or die ('MySQL connect failed. ' . mysql_error()); mysqli_select_db($dbConn,$dbName) or die('Cannot select database. ' . mysqli_error()); function dbQuery($sql) { $result = mysqli_query($dbConn,$sql) or die(mysql_error()); return $result; } ?> Quote Link to comment https://forums.phpfreaks.com/topic/309817-im-facing-database-submission-issues/page/2/#findComment-1573291 Share on other sites More sharing options...
Barand Posted January 10, 2020 Share Posted January 10, 2020 Have you not mastered copy and paste yet? // database connection config $dbHost = 'localhost'; $dbUser = ''; $dbPass = ''; $dbName = ''; mysqli_report(MYSQLI_REPORT_ERROR|MYSQLI_REPORT_STRICT); // <-- ADD IT HERE !!! $dbConn = mysqli_connect ($dbHost, $dbUser, $dbPass) or die ('MySQL connect failed. ' . mysql_error()); mysqli_select_db($dbConn,$dbName) or die('Cannot select database. ' . mysqli_error()); function dbQuery($sql) { $result = mysqli_query($dbConn,$sql) or die(mysql_error()); return $result; } Quote Link to comment https://forums.phpfreaks.com/topic/309817-im-facing-database-submission-issues/page/2/#findComment-1573292 Share on other sites More sharing options...
Frankice Posted January 10, 2020 Author Share Posted January 10, 2020 Just now, Barand said: Have you not mastered copy and paste yet? // database connection config $dbHost = 'localhost'; $dbUser = ''; $dbPass = ''; $dbName = ''; mysqli_report(MYSQLI_REPORT_ERROR|MYSQLI_REPORT_STRICT); // <-- ADD IT HERE !!! $dbConn = mysqli_connect ($dbHost, $dbUser, $dbPass) or die ('MySQL connect failed. ' . mysql_error()); mysqli_select_db($dbConn,$dbName) or die('Cannot select database. ' . mysqli_error()); function dbQuery($sql) { $result = mysqli_query($dbConn,$sql) or die(mysql_error()); return $result; } Here is the error after I correct the connection. atal error: Uncaught mysqli_sql_exception: Field 'email' doesn't have a default value in /home/psdelive/public_html/admin/add package.php:24 Stack trace: #0 /home/psdelive/public_html/admin/add package.php(24): mysqli_query(Object(mysqli), 'INSERT INTO pac...') #1 {main} thrown in /home/psdelive/public_html/admin/add package.php on line 24 Quote Link to comment https://forums.phpfreaks.com/topic/309817-im-facing-database-submission-issues/page/2/#findComment-1573297 Share on other sites More sharing options...
gw1500se Posted January 10, 2020 Share Posted January 10, 2020 There is your answer. Either you are not adding a value for email in your insert or there is a problem with your schema. Quote Link to comment https://forums.phpfreaks.com/topic/309817-im-facing-database-submission-issues/page/2/#findComment-1573301 Share on other sites More sharing options...
Frankice Posted January 10, 2020 Author Share Posted January 10, 2020 I'm happy to find this forum, the database have been updated after I removed the email field in the database .Thank you so much I appreciate your time. Quote Link to comment https://forums.phpfreaks.com/topic/309817-im-facing-database-submission-issues/page/2/#findComment-1573303 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.