A very simple script to pass a form to a databasase.... Should be simple, right? Well, the script runs without errors, the var_dump output is apparently correct, the sql statement runs when I put it in the mysql window of phpmyadmin (without the enclosing quotes that are output in the var_dump) and enters the data into the database, but when I run it for real, nothing is inserted intothe database, though the key counter is incremented. I will post the entire code for the script as well as the output of hte var_dump. I'm absolutely certain it's something really simple and stupid, but for eh life of me I cannot see it. Been fighting with this for over 40 hours. Any insight would be appreciated. ***********************************************************
<?php define('db_name', 'ssidata'); define('db_table', 'man_data'); define('db_user', '*******'); define('db_pass', '*******'); define('db_server', 'localhost'); $company = $_POST['company']; $first = $_POST['first']; $last = $_POST['last']; $position = $_POST['position']; $addr = $_POST['addr']; $city = $_POST['city']; $state = $_POST['state']; $country = $_POST['country']; $zip = $_POST['zip']; $phone = $_POST['phone']; $email = $_POST['email']; $skype = $_POST['skype']; $type = $_POST['type']; $notes = $_POST['notes']; $dbconnect = "'localhost', 'john', 'roobear', 'ssidata'"; $conn = "mysqli_connect($dbconnect)"; if (!$conn) { (die('No database table connection')); } echo "connected to database"; echo""; $user_info = "INSERT INTO man_data (company, first, namlast, position, addr, city, state, country, zip, phone, email, skype, type, notes) VALUES ($company','$first','$last','$position','$addr','$city','$state','$country','$zip','$phone','$email','$skype','$type','$notes')"; $writedata = "mysqli_query($conn $user_info)"; echo "dbconnect"; var_dump($dbconnect); echo "writedata"; var_dump($writedata); echo "user info"; var_dump($user_info); echo $user_info; if ( $writedata ) { echo "Your information was added to the database."; // mysqli_close($dbconnect); } else { die("Error posting to database: " .mysql_error()); } ?> <a href='entry_form.php'>Click to return to Data Entry Page</a>;
******************************************************************************
Var_dump for user_info 'INSERT INTO man_data (company, first, namlast, position, addr, city, state, country, zip, phone, email, skype, type, notes) VALUES (1','2','3','4','5','6','7','8','9','12','23','34','fullsystems','1234')' The only thing I can think of is the enclosing quotes but I cannot figure out how to pass that variable without them. Peace... john.