Jump to content

_Akash

New Members
  • Posts

    2
  • Joined

  • Last visited

_Akash's Achievements

Newbie

Newbie (1/5)

0

Reputation

  1. I have created a table "info" into my "akash" database. I have manually tried to populate the database, which works. But the same is not being done by the script.
  2. hello, I have just started working with php and encountered a problem in handling the MySQL database through my php script. the code is as follows: _______________________________________ <?php echo "successful!!"; $first=$_POST['first']; $last=$_POST['last']; $email=$_POST['email']; $db= mysqli_connect('localhost','root', 'akash123','akash') or die('Error in connecting to the database'); echo "</br> successful conncetion"; $query= "insert into info (first, last, email) values ($first,$last,$email)"; echo "</br> successful query"; $result= mysql_query($db,$query) or die("Error in insertion"); echo "</br> successful insertion"; mysqli_close($db); echo "the email ID of ".$first." ".$last." is ".$email; ?> _______________________________________ And the output is as follows: successful!! successful conncetion successful queryError in query I understand that all the steps prior to mysqli_query function are functioning properly. The connection to the database is established, but it cant write into it. Please help!
×
×
  • 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.