The problem is that id, start and end are getting the value 2 inside updateLine. I can see this while debugging the code in Zend Studio. What is the reason for this?
UPDATE: I need to be able to parse string values to the function updateLine.
include_once 'include/connect_db.php';
$id = '2230';
$start = '2012-10-02 11:36:13';
$end = '2012-10-02 11:36:13';
$size = count($id);
var_dump($size);
for($i = 0; $i < $size; $i++){
updateLine($id[$i], $start[$i], $end[$i]);
}
function updateLine($id, $start, $end){
var_dump($id);
var_dump($start);
$sql = "UPDATE `Sequence`
SET start='" . $start . "', fin='" . $end . "'
WHERE id='" . $id . "'";
$result=execute_query($sql);
var_dump($sql);
}
I’ve just tested and I get no errors with the following code :