Hi.
I'm having this wee problem.
I recently installed apache2, php and mysql on my freebsd-computer.
I've coded som php befor, but nothing with mysql.
Looked into a tutorial and couldn't even get their example to work.
Now here's how it look, anyone sees something wrong?
<html>
<head><title>Web Database Sample Inserting</title>
</head>
<body bgcolor=#ffffff>
<?
if (isset($name) && isset($phone)) {
mysql_connect("localhost", "webuser", "");
$query = "INSERT INTO mytable VALUES ('$name', '$phone')";
$result = mysql_db_query("example", $query);
if ($result) {
echo "<p>$name was added to the database</p>";
}
}
?>
<h1>Add an entry</h1>
<form>
Name: <input type=text name='name'><br>
Phone: <input type=text name='phone'><br>
<input type=submit>
</form>
<p><a href="index.php">Back to index</a>
</body>
</html>
the databse is up and running, I can view what's in the database, but not add anything.
The webuser has permission to insert, select and delete.
I tried "or die()" on the connect and the query lines, but they didn't help.
Thanks a bunch.