Simple MySQL DB query
Posted: Wed Oct 14, 2009 4:13 pm
My website is hosted via a hosting company, and I believe they use Linux (because the file structure is like /usr/home/USERNAME/www) and there are etc bin, etc at the "usr" level. Not sure if that helps though. I can access cpanel for my site, and I have created a simple MySQL db with one table. I have 2 users. One can do all privileges and one can only select.
Now, the entire site was made in php (by the hosting company as a service that I paid for). My question is, I want to create a simple php script to query the database (named "stores") and the table named "store_info". I can use either username right? Or should I just use the limited user or does it matter?
Anyway, I understand basic SQL syntax SELECT * FROM store_info WHERE unit_num="value". The value will come from a search box above. So picture just a simple text box, where a user would input a 5 digit number and then hit a submit button. Then, right below it, a table would show the results (the store number is the primary key in the table). What is the simplest way to do this? How do I "connect" to the database via php since I don't actually have access to the physical server? Do I need access to the server? Do I just use the server's IP as a host?
Thanks guys,
Now, the entire site was made in php (by the hosting company as a service that I paid for). My question is, I want to create a simple php script to query the database (named "stores") and the table named "store_info". I can use either username right? Or should I just use the limited user or does it matter?
Anyway, I understand basic SQL syntax SELECT * FROM store_info WHERE unit_num="value". The value will come from a search box above. So picture just a simple text box, where a user would input a 5 digit number and then hit a submit button. Then, right below it, a table would show the results (the store number is the primary key in the table). What is the simplest way to do this? How do I "connect" to the database via php since I don't actually have access to the physical server? Do I need access to the server? Do I just use the server's IP as a host?
Thanks guys,