解决 - 用户错误 - 帮助,如果一个声明一个变量,不是么?PHP函数 - 我错过了什么?
帮助,
我有以下的PHP函数代码:
function new_respondent() {
global $link;
$proc = mysqli_prepare($link, "INSERT INTO trespondent_bps (code) VALUES (uuid());");
mysqli_stmt_execute($proc);
$respondent_id = mysqli_insert_id($link);
mysqli_stmt_fetch($proc);
mysqli_stmt_close($proc);
mysqli_clean_connection($link);
return($code);
}
对于我的生活,它将UUID添加到数据库中根本没有问题 - 但它没有返回,所以我可以在代码中使用它 - 我错过了什么/做错了什么!
在此先感谢,
荷马。
'$ code'是从来没有宣布我没有逃脱它。 – Prisoner
我把它的id字段设置为AUTO INCREMENT? $代码不设置为任何东西,如果你想func返回的ID,不应该是返回($ respondent_id)? – SW4
YUP - 如下 - NUMPTY! –