Jump to content

Simple table load


Grant Holmes

Recommended Posts

I have created a four field table:

id  [int(4) auto_increment]

code [char(2)]

country [varchar(50)]

flag [blob] 

 

On my PC,I have:

a CSV file with 252 two-digit country codes (US) and country names (United States)

A folder with 252 png common-sized flag images (the flag names correspond to the country codes)

 

I want to populate my table with this information, so I can later compare a user country and display their flag next to their name.

 

I've searched the general web and this forum for a simple upload script, but everything seems to be based on forms and user uploads, resizing, blah, blah, blah.

 

I just need to populate this table with this information, and obviously keep the flags in the right record. Is there a way to write a script to parse a local folder for the data, or if I created a folder on the site, would that be easier.

 

Two important points:

1-I know next to nothing about writing PHP, but I can edit the heck out of it!!

2-My client is on Yahoo, so there are some dumb PHP restrictions and I'm stuck with that for the moment.

 

As always your kind help is appreciated.

Link to comment
Share on other sites

just found a tutorial that surrounds this issue without really answering it. It says it may be better to just store images in the site folder structure. Then in the table, just store the server path (flagimages/xxx.jpg) for each record.

 

In my case all the flag images are 32x20 px and 1k in size, so space is not really an issue, is it?

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.