problem in inserting data in Database
Posted: Sat Aug 12, 2006 3:09 pm
Hi,
I am facing a little problem, plz help.
i am posting an array from a page, and all my array values are stored in $final variable(see below code). I confirm this by print_r command.
In this variable, i got 5 different ID's, i want to store that id's in database, thats why i put my query in loop.
But the problem i am facing is that i don't know that how to insert $fianl variable value in database. Also it gives error in query.
Please correct this query syntax, so that this code will insert ID's (get from $final variable) in database. Here is a little code
Hoping for a positive response
I am facing a little problem, plz help.
i am posting an array from a page, and all my array values are stored in $final variable(see below code). I confirm this by print_r command.
In this variable, i got 5 different ID's, i want to store that id's in database, thats why i put my query in loop.
But the problem i am facing is that i don't know that how to insert $fianl variable value in database. Also it gives error in query.
Please correct this query syntax, so that this code will insert ID's (get from $final variable) in database. Here is a little code
Code: Select all
$final= unserialize(base64_decode($_POST['allsizes']));
for($c=0;$c<=count($final);$c++){
mysql_query("insert into travelagent_history (requestid,userid_travelagent)
values(' ','$final[$c]')",$db)or die(mysql_error());
}