[SOLVED]Errors inserting data from php to mysql
Posted: Tue May 15, 2007 6:48 am
feyd | Please use
and the actual query I am using is as follows:
feyd | Please use[/syntax]
Code: Select all
,Code: Select all
and [syntax="..."] tags where appropriate when posting code. Your post has been edited to reflect how we'd like it posted. Please read: [url=http://forums.devnetwork.net/viewtopic.php?t=21171]Posting Code in the Forums[/url] to learn how to do it too.[/color]
I get the following errors when trying to insert data into the mysql database:
Notice: Undefined index: null in X:\input_set.php on line 87
Notice: Undefined index: null in X:\input_set.php on line 87
Notice: Undefined index: null in X:\input_set.php on line 87
Notice: Undefined index: null in X:\input_set.php on line 87
Cannot execute query ......(except that my code doesn't output the mysql error even though I have the following code: or die("Cannot execute query ".mysql_error( )) )
The structure of the table I am trying to put data in is as follows:
[syntax="sql"]create table marinas
( marina_id tinyint unsigned not null auto_increment primary key,
is_active bool not null default 1,
marina_name char(30) not null,
abn int unsigned,
region_id tinyint unsigned not null,
index(region_id),
foreign key(region_id) references regions(region_id),
contact_first_name varchar(50),
contact_last_name varchar(50),
street_address varchar(70),
suburb varchar(25),
state char(3) not null,
index(state),
foreign key(state) references states(state),
postcode smallint unsigned,
postal_address varchar(70),
postal_state char(3),
index(postal_state),
foreign key(postal_state) references states(state),
postal_postcode smallint unsigned,
telephone_work int unsigned,
telephone_fax int unsigned,
telephone_mobile int unsigned,
telephone_emergency int unsigned,
email varchar(80),
secure_parking bool not null
) type=innodb;Code: Select all
INSERT into marinas (marina_name, abn, region_id, contact_first_name, contact_last_name, street_address, suburb, state, postcode, postal_address, postal_state, postal_postcode, telephone_work, telephone_fax, telephone_mobile, telephone_emergency, email, secure_parking) VALUES ('Kia Marina', '53004085616', '2', 'Geoff', 'Malcovich', '198B Joness St', 'Mannum', 'SA', '5079', 'abc', 'SA', '5089', '088349882', '0212345678', '0712345678', '041898627', 'bookings@kiamarina.com.au', '1')feyd | Please use[/syntax]
Code: Select all
,Code: Select all
and [syntax="..."] tags where appropriate when posting code. Your post has been edited to reflect how we'd like it posted. Please read: [url=http://forums.devnetwork.net/viewtopic.php?t=21171]Posting Code in the Forums[/url] to learn how to do it too.[/color]