Dear Experts,
I'm having an error, what's wrong with my code.
Notice: Undefined variable: ID in C:\Inetpub\ on line 15
Notice: Undefined variable: Name in C:\Inetpub\ on line 15
Notice: Undefined variable: Address in C:\Inetpub\ on line 15
could not complete your query
Heres my add.php below
------------------------------------------------------------
<?php
$host = "localhost";
$user = "joel";
$pass = "";
$database = "personal";
$table = "tblpersonal";
echo "<B>This is a list of items I have in my table named $table</B> <hr>";
// Connecting to the Database
$connection = @mysql_connect($host, $user, $pass) or die("could not connect to server"
@mysql_select_db($database, $connection);
$query = "INSERT INTO $table('ID','Name','Address')VALUES('$ID','$Name','$Address')";
// Query the Database
$result = @mysql_query($query) or die("could not complete your query"
?>
------------------------------------------------------------
and here's my add.htm
<html>
<head>
<title>Add</title>
</head>
<body>
<form method="POST" action ="add.php">
<input type="text" name="ID" size="20"></p>
<p><input type="text" name="Name" size="20"></p>
<p><input type="text" name="Address" size="20"></p>
<p><input type="submit" value="Submit" name="B1"><input type="reset" value="Reset" name="B2"></p>
</form>
</body>
</html>
------------------------------------------------------------
I'm having an error, what's wrong with my code.
Notice: Undefined variable: ID in C:\Inetpub\ on line 15
Notice: Undefined variable: Name in C:\Inetpub\ on line 15
Notice: Undefined variable: Address in C:\Inetpub\ on line 15
could not complete your query
Heres my add.php below
------------------------------------------------------------
<?php
$host = "localhost";
$user = "joel";
$pass = "";
$database = "personal";
$table = "tblpersonal";
echo "<B>This is a list of items I have in my table named $table</B> <hr>";
// Connecting to the Database
$connection = @mysql_connect($host, $user, $pass) or die("could not connect to server"
@mysql_select_db($database, $connection);
$query = "INSERT INTO $table('ID','Name','Address')VALUES('$ID','$Name','$Address')";
// Query the Database
$result = @mysql_query($query) or die("could not complete your query"
?>
------------------------------------------------------------
and here's my add.htm
<html>
<head>
<title>Add</title>
</head>
<body>
<form method="POST" action ="add.php">
<input type="text" name="ID" size="20"></p>
<p><input type="text" name="Name" size="20"></p>
<p><input type="text" name="Address" size="20"></p>
<p><input type="submit" value="Submit" name="B1"><input type="reset" value="Reset" name="B2"></p>
</form>
</body>
</html>
------------------------------------------------------------