这是我的SQL。
$sql = "SELECT updates.update_id, models.model_id, first_name, last_name, updates_models.update_id, updates_models.model_id
FROM updates, models, updates_models
WHERE updates.update_id = updates_models.update_id AND models.model_id = updates_models.model_id AND updates.update_id = $names";
我正在尝试使用$stmt->bind_param();
函数
在上面的$ sql中我是否正确认为我需要将3个值传递给$stmt->bind_param()
?
喜欢这个
$sql = "SELECT updates.update_id, models.model_id, first_name, last_name, updates_models.update_id, updates_models.model_id
FROM updates, models, updates_models
WHERE updates.update_id = ? AND models.model_id = ? AND updates.update_id = ?";
答案 0 :(得分:1)
没有, 你的外部变量只有$ name,所以你的选择将是
$sql = "SELECT updates.update_id, models.model_id, first_name, last_name, updates_models.update_id, updates_models.model_id FROM updates, models, updates_models WHERE updates.update_id = updates_models.update_id AND models.model_id = updates_models.model_id AND updates.update_id = ?";