Help me Plz.. my problem is.. when click the button submit, this will be out
Notice: Undefined variable: first in D:\LITRAS\emot\insert.php on line 20
Notice: Undefined variable: last in D:\LITRAS\emot\insert.php on line 20
Notice: Undefined variable: phone in D:\LITRAS\emot\insert.php on line 20
Notice: Undefined variable: mobile in D:\LITRAS\emot\insert.php on line 20
Notice: Undefined variable: fax in D:\LITRAS\emot\insert.php on line 20
Notice: Undefined variable: email in D:\LITRAS\emot\insert.php on line 20
Notice: Undefined variable: web in D:\LITRAS\emot\insert.php on line 20
New MySQL info added -->the data is added? but the data cannot appear in MySQL. just blank screean with id, 1, 2, 3 but no data inside. Here the code:
<?php
//if(isset($_POST['add']))
//{
include("dbinfo.inc.php");
mysql_connect($dbhost,$username,$password);
@mysql_select_db($database) or die( "Unable to select database");
$query = "INSERT INTO contacts VALUES ('','$first','$last','$phone','$mobile','$fax','$email','$web')";
mysql_query($query) or die('Error, insert query failed');
$query = "FLUSH PRIVILEGES";
mysql_query($query) or die('Error, insert query failed');
//include 'library/closedb.php';
mysql_close();
echo "New MySQL info added";
?>
<form action="insert.php"method="post">
First Name: <input type="text" name="first"><br>
Last Name: <input type="text" name="last"><br>
Phone: <input type="text" name="phone"><br>
Mobile: <input type="text" name="mobile"><br>
Fax: <input type="text" name="fax"><br>
E-mail: <input type="text" name="email"><br>
Web: <input type="text" name="web"><br>
<input type="Submit" id="add" Value="Submit">
</form>
HelpMe Plzzz