I want to make a table of users and have the table updatable via php/html. Using examples and advice off this board, I made a script that works but it does not pass any info to the mysql db.
I have 2 files- 1 is my html file with the form. The second is my php file that is activated from the submit button. The form is simple, I know that it is right. Here is my php file though:
<?php
$name = $POST['name'];
$email = $POST['email'];
$url = $_POST['url'];
$db = mysql_connect("localhost", "root", "****");
$link = mysql_select_db("music",$db);
$sql = "INSERT INTO administrators (name,email,url) VALUES ($name, $email, $url);
$result = mysql_query($sql, $link);
if ($result != '0'){
echo "You have inserted a record for: " . $name;}
else {
echo "Insert has failed";
echo "SQL STATEMENT:";
echo $sql;
}
?>
When i fill out my form and press submit, the next page tells me 'You have inserted a record for: Newperson' but when I use 'SELECT * FROM administrators' it has not changed. Is there a permission problem? I don't understand why the data isn't going in. I am using mysql/php with an apache server on win xp.