PHP/Mysql Help?????

admin

Administrator
Staff member
Pardon the intrusion, have any idea why this wouldn't insert a record into the table? The db connecting/opening is fine.

PHP Code
---------------
<?PHP $link = mysql_connect("localhost","ptacs"); ?>
<?PHP if (!$link) : ?>
<body bgcolor="#f9f2e3"> <B>The system is unable to access the database at this time, please
try your request again in a few minutes.<BR> We apologize for the incovenience.
<?PHP else: ?>
<?PHP
echo ("Connecting...<br>");
$opendb = mysql_select_db("coloradoptac", $link);
$database = "coloradoptac";
echo ("Create SQL<br>");
$sql = "INSERT INTO registration (ID,user_id,password,company,contact_name,
contact_title,president,address,city,state,
zip,zipplus4,county,phone,fax,email,url,
biz_type,biz_description,biz_org,employees,
SIC,DUNS,sales)
VALUES ('Gary','Lefko','Homebytes','Gary Lefko',
'zz','xx','cc','ss','fff',
'ww','ssss','ddd','ddd', 'ddd','dddd',
'www','A','dsdsds','ddd','22',
'ss','ddd','320.00')";
echo ("Inserting...<br>");
$query = mysql_db_query($database, $sql, $link);

echo ("Done!<br>");
?>
<?PHP endif; ?>

--------
End PHP Code


MYSQL TAble
--------------------
CREATE TABLE registration (
ID INT UNSIGNED NOT NULL AUTO_INCREMENT PRIMARY KEY,
userid varchar(10),
password varchar(10),
company VARCHAR(50),
contact_name varchar(50),
contact_title varchar(50),
president varchar(50),
address varchar(100),
city varchar(100),
state char(2),
zip char(5),
zipplus4 char(4),
county varchar(50),
phone char(12),
fax char(12),
email varchar(100),
url varchar(100),
biz_type varchar(100),
biz_description varchar(100),
biz_org varchar(50),
employees int,
SIC varchar (50),
DUNS varchar(50),
sales float
)


Gary T Lefko, TSgt, USAF, BSIT
Programmer/Analyst
Office of Institutional Research and Assessment
United States Air Force Academy
719.333.7171 (Commercial) 333.7171 (DSN)
<!-- e --><a href="mailto:[email protected]">[email protected]</a><!-- e -->
 
Back
Top