Faqts : Computers : Databases : MySQL

+ Search
Add Entry AlertManage Folder Edit Entry Add page to http://del.icio.us/
Did You Find This Entry Useful?

22 of 73 people (30%) answered Yes
Recently 2 of 10 people (20%) answered Yes

Entry

How can I do a parameterized query in mySQL?

Aug 23rd, 2009 01:01
johnny deep, dman, John Cook, http://sturly.com


Use the question mark ? character as a placeholder for parameters.
For example:  select * from tblnames where name like ? and id = ?
http://www.websitecompanyindia.com/Links5.htm
http://www.websitecompanyindia.com/Links4.htm
http://www.websitecompanyindia.com/Links3.htm
http://www.websitecompanyindia.com/Links2.htm
http://www.websitecompanyindia.com/Links1.htm
http://www.websitecompanyindia.com/Links.htm
http://www.websitecompanyindia.com/add-url-form.htm
http://www.websitecompanyindia.com/addyourlink.htm
http://www.websitecompanyindia.com/brochure-design.htm
http://www.websitecompanyindia.com/print-design.htm
http://www.websitecompanyindia.com/software-development-india.htm
http://www.websitecompanyindia.com/Internet-Marketing.htm
http://www.websitecompanyindia.com/logo-design-india.htm
http://www.websitecompanyindia.com/graphic-design.htm
http://www.websitecompanyindia.com/multimedia-webdesign.htm
http://www.websitecompanyindia.com/web-hosting-india.htm
http://www.websitecompanyindia.com/Feedback.htm
http://www.websitecompanyindia.com/Web-Development-India.htm	
http://www.websitecompanyindia.com/Web-Design-India.htm
http://www.websitecompanyindia.com/SEO-Services-India.htm
http://www.websitecompanyindia.com/About-us.htm
http://www.websitecompanyindia.com/index.html
http://www.websitecompanyindia.com/index.htm
http://www.websitecompanyindia.com/Resources.htm
http://www.websitecompanyindia.com/seo-Links.htm
http://www.websitecompanyindia.com/links.htm
http://www.websitecompanyindia.com/disclaimer.htm
http://www.websitecompanyindia.com/add-url-form.php
http://www.websitecompanyindia.com/sitemap.htm
http://www.websitecompanyindia.com/Software-Development-india.htm
http://www.websitecompanyindia.com/seo-services-india.htm
http://www.websitecompanyindia.com/web-development-india.htm
http://www.websitecompanyindia.com/web-design-india.htm
http://www.websitecompanyindia.com/Contact-us.htm
http://www.websitecompanyindia.com/Case-study.htm
http://www.websitecompanyindia.com/services.htm
http://www.websitecompanyindia.com/about-us.htm
http://www.websitecompanyindia.com/
http://www.websitecompanyindia.com/free_templates.htm
This would choose all records from table names with fields name and id 
where name is a string similar to parameter 0 and id is a number equal 
to parameter 1.