Jump to content
#StayAtHome ×
Frankice

I'm facing database submission issues

Recommended Posts

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()  )

Share this post


Link to post
Share on other sites

No, you are the programmer. If you want someone to write the program for you there is a form to hire someone.

Share this post


Link to post
Share on other sites
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;
}

?>

 

Share this post


Link to post
Share on other sites

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;
}

 

Share this post


Link to post
Share on other sites
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

 

 

Share this post


Link to post
Share on other sites

There is your answer. Either you are not adding a value for email in your insert or there is a problem with your schema.

Share this post


Link to post
Share on other sites

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.

Share this post


Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.


×
×
  • 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.