Guys, I need help!
I'm about to pull out my hair by the roots!
I'm attempting to create a 'add new user' page.
I have one page with the form, which sends the data to the php page for processing. After finally getting somewhere, all I get in the database is _ for every field except for the field emailoptout, which actually has the value of 0.
WHAT AM I DOING WRONG?
<?php
$db_name ="dbname";
$table_name ="users";
//connect to the server and select the database
$server = "localhost";
$dbusername = "dbuser";
$dbpassword = "password";
$connection = @mysql_connect($server, $dbusername, $dbpassword) or die(mysql_error());
$db = @mysql_select_db($db_name,$connection)or die(mysql_error());
echo 'connection established';
//make query to database
$sql ="SELECT * FROM $table_name WHERE member_login= '$_POST[login]'";
$result = @mysql_query($sql,$connection) or die(mysql_error());
//get the number of rows in the result set
$num = mysql_num_rows($result);
//or add it to the database
$sql_add = "INSERT INTO $table_name (account_number, contactid, organization_title,
account_name, organizationDBA, network_representative, network, member_login, member_password,
title, salutation, firstname, lastname, communication_method, phone, mobile, otherphone,
fax, email_opt_out, email) VALUES ('_$POST[accountnumber]', '_$POST[contactid]', '_$POST[organization]',
'_$POST[accountname]', '_$POST[dba]', '_$POST[rep]', '_$POST[network]', '_$POST[login]', '_$POST[password]',
'_$POST[title]', '_$POST[salutation]', '$POST[firstname]', '_$POST[lastname]', '_$POST[commethod]',
'_$POST[phone]', '_$POST[mobile]', '_$POST[other]', '_$POST[fax]', '_$POST[emailopt]', '_$POST[email]');";
$result = @mysql_query($sql_add,$connection) or die(mysql_error());
?>