hi,
I have a deadline for monday and am stuck with this:
i have numerous data from a loop that only needs to go into 1 blolb field and comma seperated. I can get each bit of info in it's own row, or just the last entry but i can not get them all into the same field!
my code is as follows:
please help!!!
Reality is built on a foundation of dreams.
I have a deadline for monday and am stuck with this:
i have numerous data from a loop that only needs to go into 1 blolb field and comma seperated. I can get each bit of info in it's own row, or just the last entry but i can not get them all into the same field!
my code is as follows:
Code:
<?php
session_start();
// open the connection
$conn = mysql_connect("localhost", "", "");
// pick the database to use
mysql_select_db("test",$conn);
if (!empty($_POST[question])) {
foreach ($_POST[question] as $value) {
if ($value == "") {
print "<li>field is empty,please go back and fill in the required fields that are missing<br>
<a href=\"javascript:history.back()\"> return to form</a>";
exit;
}else{
print "$value,";
}
$sql = "INSERT INTO test_tab (f2) VALUES ('$value')";
}
if (mysql_query($sql, $conn)) {
echo " <br>entered";
}else{
echo "nah";
}
}
?>
please help!!!
Reality is built on a foundation of dreams.