Page 1 of 1

Can someone please give me some idea about this?

Posted: Thu Dec 23, 2010 10:32 am
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.

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

Posted: Thu Dec 23, 2010 10:38 am
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.

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

Posted: Thu Dec 23, 2010 10:55 am
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!