/    Sign up×
Community /Pin to ProfileBookmark

How best to store this table in MySQL and print it with PHP?

I’ve searched the web trying to find examples of how to store tabular data in MySQL and loop through the rows to assemble a table using PHP, but no luck.

Here is a sample of my Excel file that I want to insert into MySQL. I then want to display it with PHP/HTML in its tabular form.

Keep in mind I have a lot of tables exactly like this for different countries so I am looking for a good MySQL schema to efficiently store this data, then have PHP make use of it by looping through the rows and id’s to pull the correct data.

1) How would you store this in MySQL?
2) How would you loop through the database with PHP to build columns?

Table sample can be previewed here:
[IMG]http://i844.photobucket.com/albums/ab4/m1a1911/Misc/Untitled-1-1.jpg?t=1291756360[/IMG]

to post a comment
PHP

1 Comments(s)

Copy linkTweet thisAlerts:
@BelrickDec 08.2010 — You need to be aware that this is extremely basic PHP. I'm not trying to belittle you but rather encourage you to realise that you can do this yourself and gain a lot more knowledge in the process than just cutting and pasting posted code.

Beginners tutorials is your first port of call IMHO.
×

Success!

Help @ripcurlksm spread the word by sharing this article on Twitter...

Tweet This
Sign in
Forgot password?
Sign in with TwitchSign in with GithubCreate Account
about: ({
version: 0.1.9 BETA 5.18,
whats_new: community page,
up_next: more Davinci•003 tasks,
coming_soon: events calendar,
social: @webDeveloperHQ
});

legal: ({
terms: of use,
privacy: policy
});
changelog: (
version: 0.1.9,
notes: added community page

version: 0.1.8,
notes: added Davinci•003

version: 0.1.7,
notes: upvote answers to bounties

version: 0.1.6,
notes: article editor refresh
)...
recent_tips: (
tipper: @AriseFacilitySolutions09,
tipped: article
amount: 1000 SATS,

tipper: @Yussuf4331,
tipped: article
amount: 1000 SATS,

tipper: @darkwebsites540,
tipped: article
amount: 10 SATS,
)...