我真的不想为这样一个基本问题打开一个新问题,但我需要帮助。我正在研究 mysql,刚开始使用替换变量
考虑这个简单的语句:
SELECT empid, surname
from employees
where
empid = &empid
Oracle 给我错误not all variables bound。拜托,有人能告诉我我的陈述有什么问题吗?
最佳答案
请参阅 Oracle Application Express 文档:https://docs.oracle.com/cd/E14373_01/user.32/e13370/sql_proc.htm#AEUTL228
Bind variables are prefixed with a colon.
因此将您的查询更改为:
SELECT empid, surname
from employees
where
empid = :empid
当您运行查询时,您将看到一个弹出窗口,要求您提供 :empid 的值。
关于php - mysql替换变量,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/30173445/