?

Search Help Board

PHP FAQ
PHP Articles
PHP Help
Bulletin Board

PHP Manual (NEW!)
First Time PHP'ers
Help with programming
Sql assignment help
PHP Homework Help


C# Help

?
?Urgent Help
Author:?LouD?(---.acns.fsu.edu)
Date:???04-27-04 15:42

i got this from a tutorial page. I'm doing this for a volunteer project and it's due in a week. I really need help with this. when i try to send the info collected from an html form to mysql...it doesn't send anything to the database. Anyone knows why. your help is greatly appreciated.

$title=$_POST['title'];
$message=$_POST['message'];
$author=$_POST['author'];
$email=$_POST['email'];

$location="localhost";
$username="your_db_username";
$password="your_db_password";
$database="database_name";
$conn = mysql_connect("$location","$username","$password");
if (!$conn) die ("Could not connect MySQL");
mysql_select_db($database,$conn) or die ("Could not open database");
$query = "INSERT INTO student(id,title,message,author,email) VALUES('','$title','$msg','author','email')";

$result=mysql_query($query);
mysql_close();

print "
";
print "

Your Information is entered into our database!

";

?>

?Topics Author? Date
?Urgent Help??new
LouD 04-27-04 15:42?
?Re: Urgent Help??new
bastien 04-28-04 05:13?
?Re: Urgent Help??new
LouD 04-28-04 19:07?
?Re: Urgent Help??new
LouD 04-28-04 19:09?
?Re: Urgent Help??new
bastien 04-28-04 19:17?
?Re: Urgent Help??new
LouD 04-29-04 09:41?
?Re: Urgent Help??new
ruth goldson 05-03-04 05:34?
Go to Top??|??Go to Topic??|??Flat View??|??Search?
??|??
New Topic
?Reply To This Message
?Your Name:
?Your Email:
?Subject:
Email replies to this thread, to the address above.
??wrote: > > i got this from a tutorial page. I'm doing this for a > volunteer project and it's due in a week. I really need help > with this. when i try to send the info collected from an html > form to mysql...it doesn't send anything to the database. > Anyone knows why. your help is greatly appreciated. > > $title=$_POST['title']; > $message=$_POST['message']; > $author=$_POST['author']; > $email=$_POST['email']; > > $location="localhost"; > $username="your_db_username"; > $password="your_db_password"; > $database="database_name"; > $conn = mysql_connect("$location","$username","$password"); > if (!$conn) die ("Could not connect MySQL"); > mysql_select_db($database,$conn) or die ("Could not open > database"); > $query = "INSERT INTO student(id,title,message,author,email) > VALUES('','$title','$msg','author','email')"; > > $result=mysql_query($query); > mysql_close(); > > print "
"; > print "

Your Information is entered into our database!

"; > > ?> ">??


Provided By
Phorum