If so then you should insert them using ONE "isert" statement since provided table structure shows that you have them in one record.
Use the following:
- Code: Select all
$str="";
foreach($randgen As $index => $value){
echo "value: ".$value."\n";
$str.="'$value',";
}
$str=substr($str,0,-1);
$query = "INSERT INTO draws VALUES(".$str.")";
$result = mysql_query($query);
if($result)
echo mysql_affected_rows()." draw inserted into database.";
echo"<br>";
instead of
dabith wrote:
- Code: Select all
foreach($randgen As $index => $value){
echo "value: ".$value."\n";
$query = "INSERT INTO draws VALUES('".$value."')";
$result = mysql_query($query);
if($result)
echo mysql_affected_rows()." draw inserted into database.";
}
echo"<br>";
It should work. I hope so.

