Hey,
im using a php script to get info from an excel doc and import it into a database.
the problem im having is that when i run the script it only inserts 1s into the database for eg
if i was trying to insert 45 into db it would put a 1
heres the code im using i my self cant find anything wrong
require_once '../Excel/reader.php';
$data = new Spreadsheet_Excel_Reader();
$data->read("export2010-09-06 (1).xls");
//error_reporting(E_ALL ^ E_NOTICE);
$coloumn = $_POST['table'];
$file = $_POST['file'];
mysql_connect("127.0.0.1","user","pass");
mysql_select_db("jedi");
for ($j = 1; $j <= $data->sheets[0]['numRows']; $j++)
{
$name = $data->sheets[0]['cells'][$j+1][1];
$score = $data->sheets[0]['cells'][$j+1][4];
$output = explode("/",$score);
$query = "UPDATE main SET `". $coloumn ."`=" . $output[0] . ", `" . $coloumn . "t`=" . $output[1] . " WHERE `name`='" . $name . "'";
echo $query."<br>";
mysql_query($query) or die(mysql_error());
echo $data->sheets[0]['cells'][$j+1][1]."<br>";
}
i have the script echo the name and the syntax its using what it outputs is the following
UPDATE main SET `ohs`=16, `ohst`=16 WHERE `name`='Bob'
Bob
but all im getting in ohs is 1 and in ohst im getting nothing
thanks in advance guys