getting excel data and insert to mysql table

时间:2017-08-30 20:36:42

标签: php mysql database excel xlsx

$data is getting the data from excel sheet and in the echo it displays it but it inserts null to mysql table.. here is my code after update.i dont understand why ???

Public Sub MyFunc1 (Optional CalledFromLoad As Boolean)
Public Sub MyFunc2 (Optional CalledFromLoad As Boolean)

Private Sub comboBox_AfterUpdate()
     Call MyFunc1 False
End Sub
Private Sub listbox_AFterUpdate()
   Call MyFunc2 False
End Sub
Private Sub Form_Open(Cancel As Integer)
   Call MyFunc1 True
End Sub

1 个答案:

答案 0 :(得分:1)

除了水平间距外,这里可能会遗漏某些东西:

if($i !==$highestColumnNum)
    $sql.=$data.',';
    else
    $sql.=$data.'';
    mysqli_query($connect,$sql)or die (mysqli_error($connect));

然后你有了这个:

    $sql.=')';
    mysqli_query($connect,$sql)or die (mysqli_error($connect));