Jump to content


Photo

Trying to create a spreadsheet with PHP data


  • Please log in to reply
2 replies to this topic

#1 tmiller85

tmiller85
  • New Members
  • Pip
  • Newbie
  • 2 posts

Posted 08 March 2005 - 05:11 AM

Hello. I'm new at this so hopefully I can properly explain what I'm trying to accomplish. I'm using Dreamweaver MX 2004. I'm working on a national map for my employer that shows pricing for every county in the US (http://www.uresinc.c...erage/index.php).

Right now, I have every link being sent to a page called rates.php. And on that page, it shows the County and State for the specified link. But the product pricing on the page is currently the same for every link. I'm trying to accomplish two things....

First, I want to see if there's a way to create a script or something that results in an Excel spreadsheet of columns that shows every county of every state. Then, I want to add columns for each product and input the correct pricing. There are 3,034 counties, so my spreadsheet would have that many rows. Right now, I have a tool called phpMyAdmin-2.5.6 but it requires me to manually enter the state, county, product, then price. Using this method, I would have to do that over 15,000 times if we list 5 products.

Second, if my first request is possible, I need to transfer that data into my database so that the rates.php page pulls the right pricing for the specified county. I'm not sure how that would take place, if it's even possible, so I would need some direction on that as well.

Thanks in advance for any feedback and sorry if my message seems confusing.

Ted Miller


#2 DragonFire-N[R]

DragonFire-N[R]
  • Members
  • PipPip
  • Member
  • 18 posts

Posted 08 March 2005 - 05:27 AM

If you want to display some information as a spreadsheet, you can use tables for that (simple HTML code). Seeing as how there is going to be 3,034 counties (meaning 3,034 colums), I recommend you make a script where someone selects their country and it will list all information of the specified country.

There is a way you can use queries to automatically insert data for you but if for some reason YOU have to update the pages every time there is a change then I can't think of a way to make it easier.

When it comes to transferring data, where are you getting the original data from? Is it a .sql file or maybe all of the data is built into different files on your server. It is possible, especially using phpmyadmin but will probably take some time making all of the required inserts.

Hope I have helped :)

#3 tmiller85

tmiller85
  • New Members
  • Pip
  • Newbie
  • 2 posts

Posted 08 March 2005 - 05:33 PM

Thanks for the quick reply. Yes, creating a table with every county/state is my first step. I'm just not sure how to accomplish that. Is there a way for me to create a table with the data already within my links? I imagine/hope it would look something like this:
State	County	Product1	Product2	Product3
PA	Bucks	$100  $110  $115 
PA	Chester	$125  $135  $155 
PA	Delaware	$150  $165  $175 
PA	Phila	$150  $175  $200 
So my goal is to have a format similar to the above which allows me to enter pricing for the entire country. Then, I'll work on transferring this data. Thanks again for your help.

,Mar 8 2005, 12:27 AM]If you want to display some information as a spreadsheet, you can use tables for that (simple HTML code). Seeing as how there is going to be 3,034 counties (meaning 3,034 colums), I recommend you make a script where someone selects their country and it will list all information of the specified country.

There is a way you can use queries to automatically insert data for you but if for some reason YOU have to update the pages every time there is a change then I can't think of a way to make it easier.

When it comes to transferring data, where are you getting the original data from? Is it a .sql file or maybe all of the data is built into different files on your server. It is possible, especially using phpmyadmin but will probably take some time making all of the required inserts.

Hope I have helped :)

View Post






0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users