SQL Query Not Functioning - No Error Message
- by gamerzfuse
// Write the data to the database
$query = "INSERT INTO staff (name, lastname, username, password, position,
department, birthmonth, birthday, birthyear,
location, phone, email, street, city, state, country,
zip, tags, photo)
VALUES ('$name', '$lastname', '$username', '$password', '$position',
'$department', '$birthmonth', '$birthday', '$birthyear', '$location',
'$phone', '$email', '$street', '$city', '$state', '$country',
'$zip', '$tags', '$photo')";
mysql_query($query);
var_dump($query);
echo '<p>' . $name . ' has been added to the Employee Directory.</p>';
if (!$query) {
die('Invalid query: ' . mysql_error());
}
Can someone tell me why the above code produced:
string(332) "INSERT INTO staff (name, lastname, username, password, position, department, birthmonth, birthday, birthyear, location, phone, email, street, city, state, country, zip, tags, photo) VALUES ('Craig', 'Hooghiem', 'sdf', 'sdf', 'sdf', 'sdf', '01', '01', 'sdf', 'sdf', '', 'sdf', 'sdf', 'sd', 'sdf', 'sdf', 'sd', 'sdg', 'leftround.gif')"
Craig has been added to the Employee Directory.
But does not actually add anything into the database table "staff" ?
I must be missing something obvious here.