A
Anonymous
Guest
hi
this is code of form to insert
<html>
and this code of insert inmysql
server give message it meaning that $name,$job,$age Notice: Undefined variable
help me urgent
this is code of form to insert
<html>
Code:
<head>
<title></title>
</head>
<body>
<form action="insert.php" method="post">
<p>name<input type="text" name="name">
<p>job<input type="text" name="job">
<p>age<input type="text" name="age">
<p><input type="submit" value="ok">
<input type="reset" value="return"></p>
</form>
</body>
</html>
Code:
<?php
$link = mysql_connect('localhost', 'root', '');
if (!$link) {
die('Could not connect: ' . mysql_error());
}
if (mysql_select_db('sd')) {
echo "Database selecting successfully\n";
} else {
echo 'Error selecting database: ' . mysql_error() . "\n";
}
$text = "O'Brien";
$escaped = addslashes($text);
$result = mysql_query("INSERT INTO form (id, name, job, age)
VALUES ('0', '$name', '$job', '$age')", $link);
if (!$result) {
die('Invalid query: ' . mysql_error());
}
?>
help me urgent