i got a for loop...
as many items in array i gets query for...
right now trying to insert...
future update...
error:
[FONT="Courier New"]You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '' at line 1[/FONT]
INSERT INTO tbl_tick
(comment_id,date,types,symbols,comment)
VALUES
(52,'2010-03-21 18:57:43','Buy Long','EUR/USD','We taking this entry with a stop below 1.3485'),
(51,'2010-03-19 15:06:14','Sell Short','USD/XAU','no comment'),
<?php
function export_comment($array){
$query ="";
$countarray = count($array);
for($count=0;$count<=7;$count++)
{
$query .= "(" . $array[$count][0].",'";
$query .= $array[$count][1]."','".$array[$count][2]."','".$array[$count][3]."','".mysql_real_escape_string($array[$count][4])."'),";
}
return $query;
}
if($_GET['q']=='1'){
$ticker = array_merge($ticktok,$tickso);
mysql_select_db(DBUSER, $dbarfxuser);
// build a query
$query = "INSERT INTO tbl_tick ";
$query .= "(comment_id,date,types,symbols,comment) ";
$query .= "VALUES " .export_comment($ticker);
$result = mysql_query($query, $dbarfxuser) or die("<pre>$query</pre>" . mysql_error());
$goto = "?g=1";
header("Location: $goto");
}
?>
FIXED >>><<<<
I had a coma stuck to end of the query >< if($count<=6){$coma=",";}else{$coma="";}