How can I search a sql database via my hosted website

printmedia
printmedia used Ask the Experts™
on
Hi all.

I have a very basic question: If we have a website that is hosted by 3dcart, and we want to be able to search a sql table from the website how can we do this?

The end user logs onto the website with their userid and they enter an item number in a box.

When they click a button on the website it will display the product information (this info resides on 3dcart's tables) but we want to include the item's price based on the userid. The item's price based on the userid is not on 3dcart.

Our table (myTable) is in one of our databases (myDatabase) on one of our servers (myServer). The table has 3 fields: userid, product, price.

How can I do this?

I've read that I could only do this via ASP or server side scripting.

Any advice would be great!

Thank you in advance!
Comment
Watch Question

Do more with

Expert Office
EXPERT OFFICE® is a registered trademark of EXPERTS EXCHANGE®
George Fendlerprogrammer

Commented:
I don't know anything about 3dcart. But, if it uses an sql database, you might be able to "join" a table with your userid to the 3dcart pricing table and retrieve the pricing level of the customer all in one query--assuming that I have understood your question correctly.

Author

Commented:
Right that's what we want to do. But we don't know how to start, is there a website that can show me some sample code?
programmer
Commented:
Do you know the column names of the pricing table in 3dcart?
If using mysql, at the mysql prompt type "show tables;"  to get a list of tables. Once you know the name of the pricing table type "describe pricingtable;" (use the actual name of the table.)
The "describe" command will provide you with the names of the columns and data types.

If you provide that information, we can show you a query that will return that information.

What you are talking about is called "pricing levels".
I just looked at their website and they don't provide native support for pricing levels.
If you have many products, this is going to be a nightmare to manage. You may want to try to find a cart program that supports pricing levels.

An alternative might be to redirect your customers to a catalog page of your website and have a different instance of 3dcart for each price level customer type.
George

Do more with

Expert Office
Submit tech questions to Ask the Experts™ at any time to receive solutions, advice, and new ideas from leading industry professionals.

Start 7-Day Free Trial