New to prepared statements, trying to insert php array into database with mysqli.
if(isset($_FILES['upload'])) {
if (($handle = fopen($_FILES['upload']['tmp_name'], 'r')) !== FALSE) {
while (($row = fgetcsv($handle, 1000, ",")) !== FALSE) {
$stmt = $connection->prepare("INSERT INTO sov ('BID', 'costcode', 'bidpack', 'item', 'um', 'qty', 'est', 'up') VALUES (?,?,?,?,?,?,?,?)");
$stmt->bind_param('ssssssss', $row[0], $row[1], $row[2], $row[3], $row[4], $row[5], $row[6], $row[7]);
$stmt->execute();
}
fclose($handle);
}
}
I get this error:
PHP Fatal error: Uncaught Error: Call to a member function bind_param() on bool in...
I tried LOAD DATA INFILE and got cpanel permission errors so please don't suggest.