views:

26

answers:

2

Hi! I've spent hours on this problem and for the life of me I can't figure it out, I have an Insert MYSQL command that is not executing, I've tried manually running the query on phpMyadmin and it actually does work but for some reason when the site runs the command, nothing is entered into the database. I have

$sql = "INSERT INTO beforeActivation (about, 
  firstname, lastname, businessname, typeofpractice, 
  practicespecial, gender, address, city, zip, cellphone, 
  businessphone, email, username, password, date) 
VALUES('$about', 
  '$firstname', '$lastname', '$businessname', '$typeofpractice', 
  '$practicespecial', '$gender', '$address', '$city', '$zip', '$cellphone', 
  '$businessphone', '$email', '$username', '$password', CURDATE())";

mysql_query($sql) or die(mysql_error());
$_SESSION["idForBeforeAct"] = mysql_insert_id();

Importantly, the script continues to run it does not 'die' or spit out any type of error it merely announces that the info was entered and continues to the next form. I ran the exact same query on phpmyadmin and it filled the table up with the variable names like $cellphone because they aren't assigned to anything (obviously). But the main point is the insert command is working, no syntax error, if anyone has any advice it would be a huge help thank you!

A: 

Check that you have autocommit turned on if your table is InnoDB.

Quassnoi
thanks for ur help to start, how do i check this i can use navicat or phpmyadmin
Pete Herbert Penito
k i've found all the mysql system var's nothing about autocommit
Pete Herbert Penito
A: 

i found my mistake, the command works, there was a stray opendb() function which pointed to the db prior to .com switch, sorry guys thanks for all your efforts

Pete Herbert Penito