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.
Can someone please give me some idea about this?
Moderator: General Moderators
Re: Can someone please give me some idea about this?
You need separate table for picture locations.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.
- 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?
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!
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!