0
MySQL存儲過程:傳遞變量到程序Mysql的
BEGIN
INSERT INTO `flux_zilnic` (motiv,nume_client,data_inregistrare,ora_inregistrare,status_alocare,ora_alocare,status_preluare,ora_preluare,status_rezolvare,ora_rezolvare,operator,birou,fisa_service)
SELECT '',nume_client,data_inregistrare,ora_inregistrare,'ALOCAT','$ora_alocare','','','','','$operator','BIROUL 2',''
FROM `tableta` ORDER BY id ASC LIMIT 1;
UPDATE `birouri` SET `disponibilitate` = 'OCUPAT' WHERE `birouri`.`username` = '$operator';
DELETE FROM `tableta` ORDER BY id ASC LIMIT 1;
END
PHP腳本調用該過程:
//CODE HERE
$operator = "user_name";
$current_date = date_create('');
$ora_alocare = date_format($current_date, 'H:i');
//CODE HERE
$result = mysqli_query($connection, "CALL allocateClients()");
//CODE HERE
如何傳遞變量$操作,$ ora_alocare對存儲在Mysql的程序?谷歌沒有任何好的答案。