Can someone please give me some idea about this?

Questions about the MySQL, PostgreSQL, and most other databases, as well as using it with PHP can be asked here.

Moderator: General Moderators

Post Reply
moriyan
Forum Newbie
Posts: 1
Joined: Thu Dec 23, 2010 10:28 am

Can someone please give me some idea about this?

Post by moriyan »

Can someone please give me some idea about this?

I am making my new project for school, (All School Records in my city).
I know a little PHP and MySQL,

There will be the need for pictures of all schools, one school may have 50 or even more pictures of it, and another may have only 5 photos (depending upon their physical area).

So, is there any easy way to store the picture locations in the MySQL database.

I mean currently, I can save the picture locations in the database but, every-time, I have to alter the table for doing that, if I get a new photo for that school.

But what I want is, something like only 1 column is created in the MySQL database, and there will be no alterations in the table further, if I add new photo to any school.

Just, it would be added to the database.
And when I call them on web page using PHP, arrays could also be used for that.

But, I am totally new in this kind.

Can someone help.
Thanks.
User avatar
Technical
Forum Commoner
Posts: 81
Joined: Thu Dec 02, 2010 5:30 am

Re: Can someone please give me some idea about this?

Post by Technical »

moriyan wrote:Can someone please give me some idea about this?

I am making my new project for school, (All School Records in my city).
I know a little PHP and MySQL,

There will be the need for pictures of all schools, one school may have 50 or even more pictures of it, and another may have only 5 photos (depending upon their physical area).

So, is there any easy way to store the picture locations in the MySQL database.

I mean currently, I can save the picture locations in the database but, every-time, I have to alter the table for doing that, if I get a new photo for that school.

But what I want is, something like only 1 column is created in the MySQL database, and there will be no alterations in the table further, if I add new photo to any school.

Just, it would be added to the database.
And when I call them on web page using PHP, arrays could also be used for that.

But, I am totally new in this kind.

Can someone help.
Thanks.
You need separate table for picture locations.
User avatar
novice4eva
Forum Contributor
Posts: 327
Joined: Thu Mar 29, 2007 3:48 am
Location: Nepal

Re: Can someone please give me some idea about this?

Post by novice4eva »

Humm if I understand your problem correctly then I think it is a problem of database design.
So I think you should have something like this:

COLUMNS FOR TABLE FOR SCHOOL
school_id
school_name
school_location
.....

COLUMNS FOR TABLE FOR STORING PICTURES
school_id
picture_id
picture_blob
picture_location//BUT I THINK SCHOOL LOCATION SHOULD COVER THIS, BUT MAY BE LIKE "CAFETERIA","LIBRARY" etc

But maybe i misunderstood your problem...you need to alter your table??? I wonder why!
Post Reply