SQL insert will not work

SQL insert will not work

am 19.10.2005 18:27:04 von grovesdavid

Hello,

Can anyone please explain why the following INSERT INTO query will not work.
Using phpMyadmin, no error messages, it seem to insert all NULL values, but
nothing else:

INSERT INTO buyers
(buyers_id,first_name,middle_name,last_name,house_name_numbe r,street_name,to
wn,county,post_code,landline,mobile,email_address,fax_number ,date,solicitor)

VALUES (NULL,'David','Athoney','Hopkins',25,'My Street','Some Town','This
County','PR7 7TT',0114455887,NULL,NULL,NULL,NULL,NULL),

(NULL,'George',NULL,'Braod',45,'Do Street','Done Town','Upper County','PB7
0NN',0011998777,NULL,NULL,NULL,NULL,NULL),


(NULL,'Andy','Brown','Burrel',44,'Dont Street','Do Town','Lower County','PC9
1LL',5588994476,NULL,NULL,NULL,NULL,NULL),


(NULL,'Jeff',NULL,'Brand',145,'Did Street','Donte Town','middle Upper
County','TH0 0YY',856478955,NULL,NULL,NULL,NULL,NULL),


(NULL,'Don','Brian','Bradban',5,'Doop Street','Downe Town','last Upper
County','0PP MM0',5566447788,NULL,NULL,NULL,NULL,NULL),


(NULL,'Geo','Hartfelt','Donnington',345,'Alldo Street','None
Town','Upper-Lower County','OO9 II8',775588994,NULL,NULL,NULL,NULL,NULL);


used for test purposes only..

DG)


--
MySQL Windows Mailing List
For list archives: http://lists.mysql.com/win32
To unsubscribe: http://lists.mysql.com/win32?unsub=gcdmw-win32@m.gmane.org

RE: SQL insert will not work

am 19.10.2005 18:40:05 von rnurse

You're not getting any error messages? Hmmm. I was going to suggest
making sure that:

NULL's are accepted on those columns
The data can fit in those columns
Check PK's and FK's

Try doing one insert at a time. See if that works.

Robert Nurse
STG
Contractor - Applications Development
Enterprise Management Center
Computational & Information Sciences Directorate

-----Original Message-----
From: grovesdavid@linkhomes2000.co.uk
[mailto:grovesdavid@linkhomes2000.co.uk]=20
Sent: Wednesday, October 19, 2005 12:27 PM
To: win32@lists.mysql.com
Subject: SQL insert will not work

Hello,

Can anyone please explain why the following INSERT INTO query will not
work.
Using phpMyadmin, no error messages, it seem to insert all NULL values,
but nothing else:

INSERT INTO buyers
(buyers_id,first_name,middle_name,last_name,house_name_numbe r,street_nam
e,to
wn,county,post_code,landline,mobile,email_address,fax_number ,date,solici
tor)

VALUES (NULL,'David','Athoney','Hopkins',25,'My Street','Some
Town','This
County','PR7 7TT',0114455887,NULL,NULL,NULL,NULL,NULL),

(NULL,'George',NULL,'Braod',45,'Do Street','Done Town','Upper
County','PB7 0NN',0011998777,NULL,NULL,NULL,NULL,NULL),


(NULL,'Andy','Brown','Burrel',44,'Dont Street','Do Town','Lower
County','PC9 1LL',5588994476,NULL,NULL,NULL,NULL,NULL),


(NULL,'Jeff',NULL,'Brand',145,'Did Street','Donte Town','middle Upper
County','TH0 0YY',856478955,NULL,NULL,NULL,NULL,NULL),


(NULL,'Don','Brian','Bradban',5,'Doop Street','Downe Town','last Upper
County','0PP MM0',5566447788,NULL,NULL,NULL,NULL,NULL),


(NULL,'Geo','Hartfelt','Donnington',345,'Alldo Street','None
Town','Upper-Lower County','OO9
II8',775588994,NULL,NULL,NULL,NULL,NULL);


used for test purposes only..

DG)


--
MySQL Windows Mailing List
For list archives: http://lists.mysql.com/win32
To unsubscribe:
http://lists.mysql.com/win32?unsub=3Drnurse@arl.army.mil


--
MySQL Windows Mailing List
For list archives: http://lists.mysql.com/win32
To unsubscribe: http://lists.mysql.com/win32?unsub=3Dgcdmw-win32@m.gmane.org

Re: SQL insert will not work

am 19.10.2005 21:56:53 von Dijital

What is the structure of your table? What types are each of the fields?

grovesdavid@linkhomes2000.co.uk wrote:
> Hello,
>
> Can anyone please explain why the following INSERT INTO query will not work.
> Using phpMyadmin, no error messages, it seem to insert all NULL values, but
> nothing else:
>
> INSERT INTO buyers
> (buyers_id,first_name,middle_name,last_name,house_name_numbe r,street_name,to
> wn,county,post_code,landline,mobile,email_address,fax_number ,date,solicitor)
>
> VALUES (NULL,'David','Athoney','Hopkins',25,'My Street','Some Town','This
> County','PR7 7TT',0114455887,NULL,NULL,NULL,NULL,NULL),
>
> (NULL,'George',NULL,'Braod',45,'Do Street','Done Town','Upper County','PB7
> 0NN',0011998777,NULL,NULL,NULL,NULL,NULL),
>
>
> (NULL,'Andy','Brown','Burrel',44,'Dont Street','Do Town','Lower County','PC9
> 1LL',5588994476,NULL,NULL,NULL,NULL,NULL),
>
>
> (NULL,'Jeff',NULL,'Brand',145,'Did Street','Donte Town','middle Upper
> County','TH0 0YY',856478955,NULL,NULL,NULL,NULL,NULL),
>
>
> (NULL,'Don','Brian','Bradban',5,'Doop Street','Downe Town','last Upper
> County','0PP MM0',5566447788,NULL,NULL,NULL,NULL,NULL),
>
>
> (NULL,'Geo','Hartfelt','Donnington',345,'Alldo Street','None
> Town','Upper-Lower County','OO9 II8',775588994,NULL,NULL,NULL,NULL,NULL);
>
>
> used for test purposes only..
>
> DG)
>
>

--
MySQL Windows Mailing List
For list archives: http://lists.mysql.com/win32
To unsubscribe: http://lists.mysql.com/win32?unsub=gcdmw-win32@m.gmane.org

Re: SQL insert will not work

am 19.10.2005 22:27:06 von Charles Mabbott

Can you show us the define table as far as columns? I am trying to find in
manual, but I vaguely recall a limit on how long the statement can be. I
cannot at this time put my finger on it.... go figger

Chuck

----- Original Message -----
From: "Armando"
To:
Sent: Wednesday, October 19, 2005 3:56 PM
Subject: Re: SQL insert will not work


> What is the structure of your table? What types are each of the fields?
>
> grovesdavid@linkhomes2000.co.uk wrote:
>> Hello,
>>
>> Can anyone please explain why the following INSERT INTO query will not
>> work.
>> Using phpMyadmin, no error messages, it seem to insert all NULL values,
>> but
>> nothing else:
>>
>> INSERT INTO buyers
>> (buyers_id,first_name,middle_name,last_name,house_name_numbe r,street_name,to
>> wn,county,post_code,landline,mobile,email_address,fax_number ,date,solicitor)
>>
>> VALUES (NULL,'David','Athoney','Hopkins',25,'My Street','Some Town','This
>> County','PR7 7TT',0114455887,NULL,NULL,NULL,NULL,NULL),
>>
>> (NULL,'George',NULL,'Braod',45,'Do Street','Done Town','Upper
>> County','PB7
>> 0NN',0011998777,NULL,NULL,NULL,NULL,NULL),
>>
>>
>> (NULL,'Andy','Brown','Burrel',44,'Dont Street','Do Town','Lower
>> County','PC9
>> 1LL',5588994476,NULL,NULL,NULL,NULL,NULL),
>>
>>
>> (NULL,'Jeff',NULL,'Brand',145,'Did Street','Donte Town','middle Upper
>> County','TH0 0YY',856478955,NULL,NULL,NULL,NULL,NULL),
>>
>>
>> (NULL,'Don','Brian','Bradban',5,'Doop Street','Downe Town','last Upper
>> County','0PP MM0',5566447788,NULL,NULL,NULL,NULL,NULL),
>>
>>
>> (NULL,'Geo','Hartfelt','Donnington',345,'Alldo Street','None
>> Town','Upper-Lower County','OO9 II8',775588994,NULL,NULL,NULL,NULL,NULL);
>>
>>
>> used for test purposes only..
>>
>> DG)
>>
>>
>
> --
> MySQL Windows Mailing List
> For list archives: http://lists.mysql.com/win32
> To unsubscribe:
> http://lists.mysql.com/win32?unsub=crmabbott@comcast.net
>


--
MySQL Windows Mailing List
For list archives: http://lists.mysql.com/win32
To unsubscribe: http://lists.mysql.com/win32?unsub=gcdmw-win32@m.gmane.org

Re: SQL insert will not work

am 20.10.2005 14:40:04 von Dijital

I see that the buyers_id is an auto-increment field, yet you are
including it in your queries, and trying to insert null values which
would not work. Try removing the buyers_id from the insert query
completely. Because the field is auto incrementing, you should not need
to add it to the query. The database will take care of it automatically.
Cheers.

Armando

grovesdavid@linkhomes2000.co.uk wrote:
> Hello Armando,
> Here is a MySQL dump:
>
> -- phpMyAdmin SQL Dump
> -- version 2.6.1-pl3
> -- http://www.phpmyadmin.net
> --
> -- Host: 127.0.0.1:3306
> -- Generation Time: Oct 19, 2005 at 09:25 AM
> -- Server version: 4.0.4
> -- PHP Version: 4.3.7
> --
> -- Database: `main_sell_homes_linkhomes2000`
> --
>
> -- --------------------------------------------------------
>
> --
> -- Table structure for table `buyers`
> --
>
> CREATE TABLE `buyers` (
> `buyers_id` int(10) unsigned NOT NULL auto_increment,
> `first_name` varchar(20) NOT NULL default '',
> `middle_name` varchar(20) default NULL,
> `last_name` varchar(45) NOT NULL default '',
> `house_name_number` varchar(20) NOT NULL default '',
> `street_name` varchar(45) default NULL,
> `town` varchar(45) default NULL,
> `county` varchar(45) default NULL,
> `post_code` varchar(10) default NULL,
> `landline` varchar(20) default NULL,
> `mobile` varchar(20) default NULL,
> `email_address` varchar(45) default NULL,
> `fax_number` varchar(20) default NULL,
> `date` datetime default NULL,
> `solicitor` varchar(45) default NULL,
> PRIMARY KEY (`buyers_id`)
> ) TYPE=MyISAM AUTO_INCREMENT=1 ;
>
> --
> -- Dumping data for table `buyers`
> --
>
>
> -- --------------------------------------------------------
>
> --
> -- Table structure for table `enquiries`
> --
>
> CREATE TABLE `enquiries` (
> `enquiries_id` int(10) unsigned NOT NULL auto_increment,
> `buyers_id` int(10) unsigned NOT NULL default '0',
> `property_sellers_id` int(10) unsigned NOT NULL default '0',
> `property_id` int(10) unsigned NOT NULL default '0',
> `offer` int(10) unsigned default NULL,
> `offer_date` int(10) unsigned default NULL,
> `date_in` int(10) unsigned default NULL,
> `da_out` int(10) unsigned default NULL,
> `contact_client` int(10) unsigned default NULL,
> `client_con_date` int(10) unsigned default NULL,
> `accept` int(10) unsigned default NULL,
> `reject` int(10) unsigned default NULL,
> `acep_rejt_date` int(10) unsigned default NULL,
> `client_response` int(10) unsigned default NULL,
> PRIMARY KEY
> (`enquiries_id`,`buyers_id`,`property_sellers_id`,`property_ id`),
> KEY `enquiries_FKIndex1` (`buyers_id`),
> KEY `enquiries_FKIndex2` (`property_id`,`property_sellers_id`),
> KEY `enquiries_index1178` (`offer`)
> ) TYPE=MyISAM AUTO_INCREMENT=1 ;
>
> --
> -- Dumping data for table `enquiries`
> --
>
>
> -- --------------------------------------------------------
>
> --
> -- Table structure for table `finalization`
> --
>
> CREATE TABLE `finalization` (
> `finalization_id` int(10) unsigned NOT NULL auto_increment,
> `property_sellers_id` int(10) unsigned NOT NULL default '0',
> `property_id` int(10) unsigned NOT NULL default '0',
> `sellers_id` int(10) unsigned NOT NULL default '0',
> `buyers_id` int(10) unsigned NOT NULL default '0',
> `start_date` datetime NOT NULL default '0000-00-00 00:00:00',
> `offer_date` varchar(8) NOT NULL default '',
> `completion_date` varchar(8) NOT NULL default '',
> `sell_price` int(10) unsigned NOT NULL default '0',
> PRIMARY KEY
> (`finalization_id`,`property_sellers_id`,`property_id`,`sell ers_id`,`buyers_
> id`),
> KEY `finalization_FKIndex1` (`property_id`,`property_sellers_id`),
> KEY `finalization_FKIndex2` (`sellers_id`),
> KEY `finalization_FKIndex3` (`buyers_id`)
> ) TYPE=MyISAM AUTO_INCREMENT=1 ;
>
> --
> -- Dumping data for table `finalization`
> --
>
>
> -- --------------------------------------------------------
>
> --
> -- Table structure for table `info`
> --
>
> CREATE TABLE `info` (
> `info_id` int(10) unsigned NOT NULL auto_increment,
> `date` datetime default NULL,
> `asking` int(10) unsigned default NULL,
> `selling` int(10) unsigned default NULL,
> `town` varchar(45) default NULL,
> `county` varchar(45) default NULL,
> `post_code` varchar(10) default NULL,
> `start` varchar(11) default NULL,
> `finish` varchar(11) default NULL,
> `time` varchar(11) default NULL,
> PRIMARY KEY (`info_id`)
> ) TYPE=MyISAM AUTO_INCREMENT=1 ;
>
> --
> -- Dumping data for table `info`
> --
>
>
> -- --------------------------------------------------------
>
> --
> -- Table structure for table `property`
> --
>
> CREATE TABLE `property` (
> `property_id` int(10) unsigned NOT NULL auto_increment,
> `sellers_id` int(10) unsigned NOT NULL default '0',
> `house_name_number` varchar(20) NOT NULL default '',
> `street_name` varchar(45) NOT NULL default '',
> `town` varchar(45) NOT NULL default '',
> `county` varchar(45) NOT NULL default '',
> `post_code` varchar(20) NOT NULL default '',
> `entrance_hall` varchar(45) default NULL,
> `lounges_number` int(10) unsigned NOT NULL default '0',
> `L_des` varchar(45) NOT NULL default '',
> `dinning_number` int(10) unsigned NOT NULL default '0',
> `D_des` varchar(45) NOT NULL default '',
> `kitchens_number` int(10) unsigned NOT NULL default '0',
> `K_des` varchar(45) NOT NULL default '',
> `cloaks_number` int(10) unsigned default NULL,
> `C_des` varchar(45) default NULL,
> `studies_number` int(10) unsigned default NULL,
> `ST_des` varchar(45) default NULL,
> `libaries_number` int(10) unsigned default NULL,
> `LI_des` varchar(45) default NULL,
> `utilities_number` int(10) unsigned default NULL,
> `UT_des` varchar(45) default NULL,
> `bedrooms_number` int(10) unsigned NOT NULL default '0',
> `BE_des` varchar(45) NOT NULL default '',
> `bathrooms_number` int(10) unsigned NOT NULL default '0',
> `BAT_des` varchar(45) NOT NULL default '',
> `ensuite_number` int(10) unsigned default NULL,
> `SUITE_des` varchar(45) default NULL,
> `views_des` varchar(45) default NULL,
> `brief_des` varchar(45) NOT NULL default '',
> `expand_des` varchar(255) NOT NULL default '',
> `security_des` varchar(45) default NULL,
> `double_glazing` varchar(45) default NULL,
> `construction_des` varchar(20) default NULL,
> `when_built` varchar(10) default NULL,
> `nhbc_cert` char(2) default NULL,
> `property_type` varchar(20) default NULL,
> `if_flat_expand` varchar(45) NOT NULL default '',
> `REA_gardens_des` varchar(20) default NULL,
> `FRO_gardens_des` varchar(20) default NULL,
> `decor_des` varchar(45) default NULL,
> `heating_des` varchar(45) default NULL,
> `HEA_main` varchar(20) default NULL,
> `photo` varchar(45) default NULL,
> `actual_cost` int(10) unsigned NOT NULL default '0',
> `under_offer` tinyint(1) default NULL,
> `power_gas` varchar(20) default NULL,
> `POW_elec` varchar(20) default NULL,
> PRIMARY KEY (`property_id`,`sellers_id`),
> KEY `property_FKIndex1` (`sellers_id`),
> KEY `property_index1176` (`town`,`county`)
> ) TYPE=MyISAM AUTO_INCREMENT=1 ;
>
> --
> -- Dumping data for table `property`
> --
>
>
> -- --------------------------------------------------------
>
> --
> -- Table structure for table `sellers`
> --
>
> CREATE TABLE `sellers` (
> `sellers_id` int(10) unsigned NOT NULL auto_increment,
> `user_name` varchar(20) NOT NULL default '',
> `password_2` varchar(20) NOT NULL default '',
> `date` datetime NOT NULL default '0000-00-00 00:00:00',
> `first_name` varchar(20) NOT NULL default '',
> `middle_name` varchar(45) NOT NULL default '',
> `last_name` varchar(45) NOT NULL default '',
> `email_address` varchar(60) default NULL,
> `landline` varchar(20) NOT NULL default '',
> `mobile` varchar(25) default NULL,
> `fax_number` varchar(20) default NULL,
> `variable_cost` int(10) unsigned default NULL,
> PRIMARY KEY (`sellers_id`)
> ) TYPE=MyISAM AUTO_INCREMENT=1 ;
>
> --
> -- Dumping data for table `sellers`
> --
>
> DG)
>
>
> ----- Original Message -----
> From: "Armando"
> To:
> Sent: Wednesday, October 19, 2005 8:56 PM
> Subject: Re: SQL insert will not work
>
>
>
>>What is the structure of your table? What types are each of the fields?
>>
>>grovesdavid@linkhomes2000.co.uk wrote:
>>
>>>Hello,
>>>
>>>Can anyone please explain why the following INSERT INTO query will not
>
> work.
>
>>>Using phpMyadmin, no error messages, it seem to insert all NULL values,
>
> but
>
>>>nothing else:
>>>
>>>INSERT INTO buyers
>>>
>
> (buyers_id,first_name,middle_name,last_name,house_name_numbe r,street_name,to
>
> wn,county,post_code,landline,mobile,email_address,fax_number ,date,solicitor)
>
>>>VALUES (NULL,'David','Athoney','Hopkins',25,'My Street','Some
>
> Town','This
>
>>>County','PR7 7TT',0114455887,NULL,NULL,NULL,NULL,NULL),
>>>
>>>(NULL,'George',NULL,'Braod',45,'Do Street','Done Town','Upper
>
> County','PB7
>
>>>0NN',0011998777,NULL,NULL,NULL,NULL,NULL),
>>>
>>>
>>>(NULL,'Andy','Brown','Burrel',44,'Dont Street','Do Town','Lower
>
> County','PC9
>
>>>1LL',5588994476,NULL,NULL,NULL,NULL,NULL),
>>>
>>>
>>>(NULL,'Jeff',NULL,'Brand',145,'Did Street','Donte Town','middle Upper
>>>County','TH0 0YY',856478955,NULL,NULL,NULL,NULL,NULL),
>>>
>>>
>>>(NULL,'Don','Brian','Bradban',5,'Doop Street','Downe Town','last Upper
>>>County','0PP MM0',5566447788,NULL,NULL,NULL,NULL,NULL),
>>>
>>>
>>>(NULL,'Geo','Hartfelt','Donnington',345,'Alldo Street','None
>>>Town','Upper-Lower County','OO9
>
> II8',775588994,NULL,NULL,NULL,NULL,NULL);
>
>>>
>>>used for test purposes only..
>>>
>>>DG)
>>>
>>>
>>
>>--
>>MySQL Windows Mailing List
>>For list archives: http://lists.mysql.com/win32
>>To unsubscribe:
>
> http://lists.mysql.com/win32?unsub=grovesdavid@linkhomes2000 .co.uk
>
>>
>>
>
>

--
MySQL Windows Mailing List
For list archives: http://lists.mysql.com/win32
To unsubscribe: http://lists.mysql.com/win32?unsub=gcdmw-win32@m.gmane.org