Forum Moderators: coopster

Message Too Old, No Replies

Can't Write in the Database using INSERT INTO

PHP/MySQL

         

Francis

4:21 am on Jul 20, 2005 (gmt 0)

10+ Year Member



This is my script:

$table_to_use = "irr_accounts";
include ($_SERVER['DOCUMENT_ROOT'].'/snippets/cnx.php');

$query = "INSERT INTO $table_to_use (account_number, handling_branch, acct_type, school, address, street, city, contact_person, contact_number, first_name, last_name, date_applied, date_approved, end_date, status) VALUES

('$account_number', '$handling_branch', '$account_type', '$school', '$address', '$street', '$city', '$contact_person', '$contact_number', '$first_name', '$last_name', '00-00-00', '00-00-00', '00-00-00', '$status')";

mysql_query("COMMIT");

Looks ok. However, it is not writing. Please help. Thanks.

jaski

4:32 am on Jul 20, 2005 (gmt 0)

10+ Year Member



> mysql_query("COMMIT");

try this instead

mysql_query($query);

Francis

4:38 am on Jul 20, 2005 (gmt 0)

10+ Year Member



Wow. Thanks very much for the help! IT WORKED!