Jump to content

[SOLVED] Not inserting into db


Clinton

Recommended Posts

All the variables are being passed correctly, the table name and columns are correct, no errors are being generated... but the information is not being inserted into my db. Any ideas?

 

 

<?
mysql_connect("localhost", "******", "********") or die(mysql_error());
mysql_select_db("anderse_inventory") or die(mysql_error());

mysql_query("INSERT INTO roster (Name, Title, CellPhone, HomePhone, Email, Notes, Position, Terminated)
VALUES ('".$_POST['Name1']."', '".$_POST['Title1']."', '".$_POST['CellPhone1']."', '".$_POST['HomePhone1']."', '".$_POST['Email1']."', '".$_POST['Notes1']."', '".$_POST['Position1']."', '".$_POST['Terminated1']."')");

?>

<? echo $_POST['Name1']?> has been added to the database. <a href="keyper2.php">Return</a><br>

<? echo $_POST['Title1']?><br>

<? echo $_POST['CellPhone1']?><br>

<? echo $_POST['HomePhone1']?><br>

<? echo $_POST['Email1']?><br>

<? echo $_POST['Notes1']?><br>

<? echo $_POST['Position1']?><br>

<? echo $_POST['Terminated1']?><br>

Link to comment
https://forums.phpfreaks.com/topic/68849-solved-not-inserting-into-db/
Share on other sites

mysql_query("INSERT INTO roster (Name, Title, CellPhone, HomePhone, Email, Notes, Position, Terminated)
VALUES ('".$_POST['Name1']."', '".$_POST['Title1']."', '".$_POST['CellPhone1']."', '".$_POST['HomePhone1']."', '".$_POST['Email1']."', '".$_POST['Notes1']."', '".$_POST['Position1']."', '".$_POST['Terminated1']."')");

 

change too: 

 

mysql_query("INSERT INTO roster (Name, Title, CellPhone, HomePhone, Email, Notes, Position, Terminated)
VALUES ('".$_POST['Name1']."', '".$_POST['Title1']."', '".$_POST['CellPhone1']."', '".$_POST['HomePhone1']."', '".$_POST['Email1']."', '".$_POST['Notes1']."', '".$_POST['Position1']."', '".$_POST['Terminated1']."')")or die( mysql_error() );

 

and then see if any error is outputted...

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.