我想将我的数据库从 SQL Server 同步到 Mysql,但出现以下错误:
致命错误:在第 36 行的 php 中只能通过引用传递变量
这是我的代码:
// connect to MSSQL
$koneksi=mssql_connect($server,$username,$password);
$sqldb=mssql_select_db($database,$koneksi);
// connect to MySQL
$koneksi2 = mysqli_connect($server2,$username2,$password2,$database2,$port);
// copy data from MSSQL to MySQL
$query2 = mssql_query("Select Jabatan, Nama, NIP from PejabatPenetap",$koneksi);
while($r=mssql_fetch_array($query2)) {
$jabatan = $r['Jabatan'];
$nama = $r['Nama'];
$nip = $r['NIP'];
$stmt = mysqli_prepare($koneksi2, 'StoredProcedure');
mysqli_bind_param($stmt, '@jabatan', $jabatan, SQLVARCHAR, false, false, 255); <-- this is line 36
mysqli_bind_param($stmt, '@nama_input', $nama, SQLVARCHAR, false, false, 100);
mysqli_bind_param($stmt, '@nip', $nip, SQLVARCHAR, false, false, 25);
$res = mysqli_stmt_execute($stmt);
}