how to solve if Value does not insert into database...
Posted: Tue Oct 30, 2007 3:55 am
I have a very simple query for inserting value in the database. that is as follows:
$add_query="insert into sponsors values('','$_REQUEST[idda]','$_REQUEST[myID]')";
$add_query=mysql_query($add_query)or die("Value cannot be inserted..");
here the name of the table is 'sponsors' the structure of the table is as follows:
CREATE TABLE `sponsors` (
`id` int(10) NOT NULL auto_increment,
`sponsoring_id` int(10) default NULL,
`sponsored_id` int(10) default NULL,
PRIMARY KEY (`id`)
)
i have checked the value is passing correctly for $_REQUEST[idda]' and $_REQUEST[myID]')". here first field is auto increment.
But these values are not inserted in database
here is a sample . when i echoed the $add_query.:
insert into sponsors values('','171 ','62')Value cannot be inserted.
why it may happen?
$add_query="insert into sponsors values('','$_REQUEST[idda]','$_REQUEST[myID]')";
$add_query=mysql_query($add_query)or die("Value cannot be inserted..");
here the name of the table is 'sponsors' the structure of the table is as follows:
CREATE TABLE `sponsors` (
`id` int(10) NOT NULL auto_increment,
`sponsoring_id` int(10) default NULL,
`sponsored_id` int(10) default NULL,
PRIMARY KEY (`id`)
)
i have checked the value is passing correctly for $_REQUEST[idda]' and $_REQUEST[myID]')". here first field is auto increment.
But these values are not inserted in database
here is a sample . when i echoed the $add_query.:
insert into sponsors values('','171 ','62')Value cannot be inserted.
why it may happen?