Here is my php code that I want to add to a database called guestbook.I m using phpadmin..
<?php
$user="root";
$password="";
$database="Guestbook";
mysql_connect("localhost",$user,$password);
@mysql_select_db($database)or die("unable to select db");
$query = mysql_query("INSERT INTO Guestbook VALUES('','abc','def','ghi')");
mysql_close();
?>
and this is my html file which contains a form from which I want to add data to the database
<html> <head> <title>blah</title> <body> <form action="new1.php" method="post"> Name:<input type="text" name=" Name" size="30"/><br/> Email: <input type="text" name="email" size="30"/><br/> <p>Text:<br/> <textarea name="body" rows="15" cols="60"></textarea></p> <br/> <input tabindex="9" type="submit" value="Submit"/> <input tabindex="10" type="reset" value="Clear"/> </form> </body> </html>
So what I did as I created a table successfully in phpmyadmin thats all..now Im trying to insert data but not working..I would liek to make a bottom adding guestbook..
This post has been edited by Dormilich: 06 January 2011 - 03:31 PM
Reason for edit:: please use [code] /* your code source here */ [/code] tags when posting code

New Topic/Question
Reply




MultiQuote







|