Forum Moderators: coopster
<form action="<?php echo($PHP_SELF);?>" method="post">
ID: <input type = "text" name = "id" size = "3">
Place Name : <input type = "text" name = "name"" size = "10">
Info : <input type = "text" name = "info" size = "40">
<br>
<input type = "submit" value ="Submit">
</form>
<?php
if ( $id and $name and $info)
{
$conn=@mysql_connect("localhost","user","pass")
or die ("Err:Conn");
$rs = @mysql_select_db("nightlife_review", $conn)
or die ("Err:DB");
$sql="insert into places (id, name, info) values ( '$id', '$name', '$info')";
$rs=mysql_query($sql,$conn);
if($rs) {echo("Record Added:$id $name $info"); }
}
?>
</body></html>
User/Pass have been changed.
Why does this not work? It just does nothing.
I have been told it may be to do with global variables?
I get this notice (if I have error_all on)
Notice: Undefined variable: id in c:\apache\htdocs\west-midlands\add_record.php on line 14
Jon