Hello All iam not great with PHP and such but i have a script thats trying to insert into my db. It used to work and then i got creatvie with it. I think i have an error somewhere in here $dbLink = mysql_connect($host, $username, $password); if(!$dbLink) die("Could not connect to database. " . mysql_error()); mysql_select_db($dbname); mysql_query("INSERT INTO $table (id,name,email,category,title,article,tags,package,date) VALUES ('','$name','$email','$category','$title','$article','$tags','$package','$date')"); in any case I was willing to pay for someones time to look over the file. Please pm me if you have a moment Thanks! Alex
Hi Alex Replace the query code with this and post the error that php gives: if (!mysql_query("INSERT INTO $table (id,name,email,category,title,article,tags,package,date) VALUES ('','$name','$email','$category','$title','$article','$tags','$package','$date')")) { die('Invalid query: ' . mysql_error()); } PHP: Brew
this is what was above that sql statement from before <?php $host ="localhost"; $username="adfmeadia_orderad"; $password="letmaein23"; $dbname="adfmeddia_bnadmin"; $table = "oneeidfght"; $name = $_POST['Name']; $email = $_POST['Email']; $category = $_POST['category']; $title = $_POST['Title']; $article = $_POST['article']; $package = $_POST['package']; $date = date("F j, Y, g:i a"); $name = htmlentities($name); $email = htmlentities($email); $title = htmlentities($title); $dbLink = mysql_connect($host, $username, $password); if(!$dbLink) die("Could not connect to database. " . mysql_error()); mysql_select_db($dbname); So it seems like iam setting the db name