回复 4# xms77
问题依旧啊,这个是mysql.au3中的_AddRecordFunc _AddRecord($oConnectionObj, $sTable, $vRow, $vValue = "")
If IsObj($oConnectionObj) Then
$query = "INSERT INTO " & $sTable & " ("
If IsArray($vRow) Then
For $i = 0 To UBound($vRow, 1) - 1
If $i > 0 And $i <> UBound($vRow, 1) - 1 Then
$query = $query & "," & $vRow[$i] & ""
ElseIf $i = UBound($vRow, 1) - 1 And $vRow[$i] <> "" Then
$query = $query & "," & $vRow[$i] & ") VALUES("
ElseIf $i = 0 Then
$query = $query & "" & $vRow[$i] & ""
ElseIf $vRow[$i] = "" Then
$query = $query & ") VALUES("
EndIf
Next
EndIf
If Not IsArray($vRow) And Not IsArray($vValue) And Not IsInt($vValue) Then
$oConnectionobj.execute ("INSERT INTO " & $sTable & " (" & $vRow & ") VALUES('" & $vValue & "')")
return 1
ElseIf IsInt($vValue) And Not IsArray($vRow) And Not IsArray($vValue) Then
$oconnectionobj.execute ("INSERT INTO " & $sTable & " (" & $vRow & ") VALUES(" & $vValue & ")")
return 1
EndIf
If IsArray($vValue) Then
For $i = 0 To UBound($vValue, 1) - 1
If $i > 0 And $i <> UBound($vValue, 1) - 1 And Not IsInt($vValue[$i]) Then
$query = $query & ",'" & $vValue[$i] & "'"
ElseIf $i = UBound($vValue, 1) - 1 And $vValue[$i] <> "" And Not IsInt($vValue[$i]) Then
$query = $query & ",'" & $vValue[$i] & "');"
ElseIf $i = 0 And Not IsInt($vValue[$i]) Then
$query = $query & "'" & $vValue[$i] & "'"
ElseIf $vValue[$i] = "" Then
$query = $query & ");"
ElseIf IsInt($vValue[$i]) And $vValue[$i] <> "" Then
$query = $query & "," & $vValue[$i]
EndIf
Next
EndIf
If StringRight($query, 2) <> ");" Then
$query = $query & ");"
EndIf
$oconnectionobj.execute ($query)
EndIf
If Not IsObj($oConnectionObj) Then
SetError(2)
Return 0
EndIf
If @error And IsObj($oConnectionObj) Then
Return 0
SetError(1)
Else
Return 1
EndIf
EndFunc ;==>_AddRecord
代码我这样写的
dim $tvalues[3]
$tvalues[0] = "pc"
$tvalues[1] = "email"
$tvalues[2] = "";
_AddRecord($connected,'s',$tvalues,$tvalues) |