I have two stings
a, b, d, e
and
1, 52, 34, 56
I want combine two strings as
a/1, b/52, d/34, e/56
I wrote my code like that:-
$result2 = mysql_query($query2);
while($row2=mysql_fetch_array($result2)){
$arr2 = explode(",",$row2['string1']);
$arr1 = explode(",",$row2['string2']);
for($i2 = 0; $i2 < count($arr1); $i2++) {
$raw_str = "".$arr2[$i2]."/".$arr1[$i2].",";
$query3 = "UPDATE table SET com_str='".$raw_str."' WHERE id='".$row2['id']."'";
if (!mysql_query($query3))
{
die('Error: ' . mysql_error());
}
}
}
my code just can store a last value only into databese:-
e/56,
But I want store full string into database.
Thanks for advance