Syntax for input parameters in MySQL query

We recently switched the database from MSSQL to MySQL, and queries that use parameters no longer work.

Here is an example query in MSSQL:

SELECT * FROM users u WHERE u.ID = :id 

Usually the parameter browser will pop up and ask me for a value for: id, but in MySQL I get this error:

You have an error in the SQL syntax; check the manual that matches your version of MySQL server for the correct syntax used next to ': id'

I tried using @ or? not: and it doesn't work.

Thanks in advance for your help.

+4
source share
1 answer
Syntax

does not match

 set @id:=123; SELECT * FROM users u WHERE u.ID = @id; 

Documents for custom variables

+18
source

All Articles