Jump to content

[SOLVED] What am I doing wrong?????


JayCee

Recommended Posts

I'm running XAMPP and I have created a form using HTML, I have written the following code in PHP in order to store the data into my DB:

 

<?php

$Name = $_Post['Name'];

$Surname = $_Post['Surname'];

$Comment = $_Post['Comment'];

 

mysql_connect ("localhost","root","test") or die ('Error: ' . mysql_error());

mysql_select_db ("results");

 

$query="INSERT INTO entries (Name, Surname, Comments)VALUES ('".$Name."','".$Surname."','".$Comment."')";

 

mysql_query($query) or die ('Error updating database');

 

ECHO "UPDATED";

 

?>

 

I keep getting the message Error updating database and obviously no data in my DB, anyone help me with what I'm doing wrong?

 

Thanks in advance!!!!!

 

JC

Link to comment
https://forums.phpfreaks.com/topic/162553-solved-what-am-i-doing-wrong/
Share on other sites

Archived

This topic is now archived and is closed to further replies.

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