Hello,
How can I insert and reterive data from database.
Suppose there is $variable[] with 20 values coming from previous dataentry page.
$indexID = $_POST['index'] //say index = 5512
$variable[] = $_POST['variable'];
do I need to use list to reterive each and every value from array, assign to a variable and store it? Like:
list($variable1, $variable2,.......,$variable20) = $variable[];
mysql_query("INSERT INTO table (indexID,variable1,variable2,....variable20) VALUES('$indexID','$variable1','$variable2',........,'$variable20')");
Is there any way like:
mysql_query("INSERT INTO table (indexID,variable*) VALUES('$indexID','variable[]')");
and how about retrieving array from database? I do know about extracting each and every variable method but how about using array way?
Thanks in advance 🙂