I suspect that this is a database issue and not a php programming issue. I have a url string which I want to insert in the db separated by commas:
PHP Code:
mysql_select_db($dbname, $con);
$sql = "INSERT INTO ".$dbtable." ( ";
for($i=0; $i<count($COLORS); $i++){
$sql .= "txtarea".$i.",";
}
$sql .= "id0,
book0,
bookTitle0,
chapter0,
verse0,
id1,
book1,
bookTitle1,
chapter1,
verse1,
comments
) VALUES ( ";
for($i=0; $i<count($COLORS); $i++){
$sql .= "'".$_GET["keyword".$i]."', ";
}
$sql .= "'".$_GET['bibleid0']."',
'".$_GET['book0']."',
'".$_GET['btitle0']."',
'".$_GET['chapter0']."',
'".$_GET['verse0']."',
'".$_GET['bibleid1']."',
'".$_GET['book1']."',
'".$_GET['btitle1']."',
'".$_GET['chapter1']."',
'".$_GET['verse1']."',
'".str_replace("'", "\'", $_GET['comments'])."'
)";
within one field I want to enter a set of numbers separated by a comma or a plus sign or something else. And the result I get is an empty spot after the comma. When I type print_r to see if the array is passed on from the url everything is there. But it's not inserted properly.
As an example if the array has (1, 2, 3, 4, 5) it would insert maybe the first 3 results 1, 2, 3, and that's it.