|fetch data from database (batch)|
I am hoping someone would be able to point me to the right direction for solving my problem.
I wish to type a part number and make php fetch its corresponding price from a mysql database. The database will have list of part number with its prices.
The problem that I have is that I need to do this several thousand times.
The part numbers, at the moment, are in a quarkxpress table, which can be converted to text and then extracted to just simple text, one item on a line.
ideally i would like to convert the table to text and make PHP fetch the prices , say 50, item at a time.
i appreciate your help in advance.
Welcome aboard jacka, Quark Express -now there's a name I haven' heard in a while. :-)
I think you'll need to hire someone, or begin experimenting with softwares that can do this for you. First you'll have to create and prepare a database that will accept your data. Then you'll take your exported text and import it into the database. Depending on the format, there are a number of ways to do this, some with a single mySQL command.
Then you need an API, a programming interface to connect with the database, extract, and display the data (which is a fancy term for a server side script, which can be in any language but since you've posted in PHP, we'll presume PHP.) At the heart of it, what you ask for is a single line
select price from my_table where part number in (1,2,3,4,5,6) order by price desc
... which gives you a set of results you output with your PHP script.
The alternative, of course, is to hire someone good at PHP to build it for you.
Thanks for the welcome and your help.
It sure has pointed my towards a new way of doing it.
The trick of course is find a way to do it one page at a time and quickly as there are about 800 pages.
The way i will have to do then, as you have suggested,is to copy the part numbers columns, from quark, to a text file a few pages a time and write a php code to get the corresponding prices and copy those prices back into the price column in quark, since I already have the prices in a different database table.
We do have a quark extension that used to do it but unfortunately its not Quark table compatible.
Once again, many thanks, its much appreciated.
You're saying there are 800 Quark Express pages?
You should be able to come up with some sort of batch action to apply within Quark to do this (don't quote me on that, been a really long time since I've used Quark.) Maybe an extension?