简体   繁体   中英

MySQL Workbench user input

My Question is how to get @userinput to work with mySQL.

Here is an example

SELECT *
FROM film
WHERE titel = @userinput;

but this query wont work with SQL workbench If someone could help me with this that would be amezing

Welcome, since you come from MS Access environment your perception of Database might be different. In Ms Access, you have inbuilt database and variety of other features in the form of front-end.

MySQL is pure database where you work with SQL language which is pure text. With MySQL workbench you can create and mange MySQL schemas/tables/diagrams but it does not give you a front-end like MS Access does.

to have a user form you need to develop your own application, either in MS ACCESS or any other application which can connect to MySQL server and work with the tables.

Other than that: if you would like to work with parameters in MySQL, either you need to create stored procedures which take parameters, or set the parameters like

something like this;

SET @mTest := 'This is a test';
Select tbl_test where testField like @mTest;

hope you understand the different between MS Access and a database server.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM