Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations IamaSherpa on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

query select statement

Status
Not open for further replies.

Barra44

Programmer
Dec 18, 2001
50
AU
I want to write a select statement to retrieve a record based on a criterior, input by the user.
can someone please show me how this is written please.

Thankyou
 
What exactly do you mean by criteria? If I understand you correctly, let's say you have a table with ID and Name and user want to see everything that have ID > 5. If this is the case, then all you need to do is SELECT * FROM tbl_name WHERE ID > 5. now to have this correspond to different user input. you would have your original SQL statement as SELECT * FROM tbl_name WHERE and then extract the text input by user and concat the two string together and execute the SQL Statement.

Hung-Hsun Su
 
thankyou for your response, yes that is what Im trying to do

Select * from Clients
where Companyname = ?


? is the input by a user

This is what I am trying to write, but I dont know the proper way to write the right syntax.

thankyou
 
As you can yell Im new to this.
I installed MySQL 4.0.1
and am using MySQL Front for developing .

Im sorry if Im not giving you enough info to explain myself.
If I was disscussing Microsoft Access I would be more comfortable with explainations.

 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top