homepage Welcome to WebmasterWorld Guest from 54.224.202.109
register, free tools, login, search, pro membership, help, library, announcements, recent posts, open posts,
Become a Pro Member
Home / Forums Index / Code, Content, and Presentation / PHP Server Side Scripting
Forum Library, Charter, Moderators: coopster & jatar k

PHP Server Side Scripting Forum

    
fetch data from database (batch)
jacka




msg:4426415
 10:11 am on Mar 8, 2012 (gmt 0)

Hi
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.

 

rocknbil




msg:4426547
 4:44 pm on Mar 8, 2012 (gmt 0)

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.

jacka




msg:4427048
 5:02 pm on Mar 9, 2012 (gmt 0)

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.

rocknbil




msg:4428152
 3:31 pm on Mar 12, 2012 (gmt 0)

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?

Global Options:
 top home search open messages active posts  
 

Home / Forums Index / Code, Content, and Presentation / PHP Server Side Scripting
rss feed

All trademarks and copyrights held by respective owners. Member comments are owned by the poster.
Home ¦ Free Tools ¦ Terms of Service ¦ Privacy Policy ¦ Report Problem ¦ About ¦ Library ¦ Newsletter
WebmasterWorld is a Developer Shed Community owned by Jim Boykin.
© Webmaster World 1996-2014 all rights reserved