473,437 Members | 1,665 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,437 software developers and data experts.

populating a table

anfetienne
424 256MB
i have a upload image form which has a caption field with it. It is possible to upload 5 images to start but by clicking a button you can add extra fields.

the images get uploaded to my server to two seperate folders, then both get resized and renamed....1 for thumbnails and 1 for the actual image. they are then moved into a folder that correspondes with the project number that gets created at the start of the process.

what i want to know is....once ive used php to create a table with the project number as a name, is it possible to populate that table with the locations of the thumbnails, images and captions? but the way i want it to be done is each image starts on a new line.

so image 1 would be on row 1, image 2 would be on row 2 and so forth? is it possible or does it only populate one row at a time?
Jul 14 '09 #1
3 2583
anfetienne
424 256MB
i have solved my problem.....thanks
Jul 14 '09 #2
Atli
5,058 Expert 4TB
I'm glad to hear that.

One thing troubles me tho.
what i want to know is....once ive used php to create a table with the project number as a name, [...]
I wouldn't recommend dynamically adding / removing tables. It is usually a sign of less then ideal table structures.

What would be better; create two tables, one to contain a list of projects, and a second to contain the data you currently put in your tables.
Then add a column to the second table that points to the correct project in the first table.

For example, if you have this:
Expand|Select|Wrap|Line Numbers
  1. Table: Data_Project1
  2. +----+-------+
  3. | ID | Value |
  4. +----+-------+
  5. |  1 | Val1  |
  6. |  2 | Val2  |
  7. +----+-------+
  8.  
  9. Table: Data_Project2
  10. +----+-------+
  11. | ID | Value |
  12. +----+-------+
  13. |  1 | Val3  |
  14. |  2 | Val4  |
  15. +----+-------+
You would usually be much better of using something more like this:
Expand|Select|Wrap|Line Numbers
  1. Table: Project
  2. +----+-----------+
  3. | ID | Name      |
  4. +----+-----------+
  5. |  1 | Project1  |
  6. |  2 | Project2  |
  7. +----+-----------+
  8.  
  9. Table: Data
  10. +----+-----------+-------+
  11. | ID | ProjectID | Value |
  12. +----+-----------+-------+
  13. |  1 |         1 | Val1  |
  14. |  2 |         1 | Val2  |
  15. |  3 |         2 | Val3  |
  16. |  4 |         2 | Val4  |
  17. +----+-----------+-------+
There you don't have to manipulate the tables themselves, just the data inside them, which is much easier to maintain (at least until you reach a massive database size).

Adding a new project becomes as simple as adding a new row to the Projects table, rather then create a entirely new table for it. And if you need to store additional data on the projects themselves, that can simply be added to the Projects table, whereas before you would have no way to add Project details, other then having them detaches somewhere in yet another table.
Jul 14 '09 #3
anfetienne
424 256MB
hi thanks for the advice i came to the conclusion hat it would be better to do as you suggested just after i found what i was looking for.

thanks for the help
Jul 15 '09 #4

Sign in to post your reply or Sign up for a free account.

Similar topics

7
by: Drew | last post by:
I have a db table like the following, UID, int auto-increment RegNo Person Relation YearsKnown Now here is some sample data from this table,
1
by: Mike P | last post by:
I am populating a drop down column in a datagrid on page load. Here is my code : <asp:TemplateColumn> <ItemTemplate> <asp:DropDownList ID="ddlUserName" Font-Name="Verdana" Font-Size="8pt"...
3
by: sck10 | last post by:
Hello, I am creating a form for users to enter information about a lab and the members of the lab. I have one form (FormView) that they use to enter information about that lab. The keyvalue is...
6
by: p.mc | last post by:
Hi all, I have a MS SQLServer database which has two tables, 'images' and 'photographers'. The photographer table contains a field for PhotographerID and a one for PhotographerName. The image...
34
by: MLH | last post by:
http://www.opm.gov/Fedhol/ http://www.opm.gov/Fedhol/2008.asp Federal law (5 U.S.C. 6103) establishes the following public holidays for Federal employees. Please note that most Federal employees...
13
by: Mary | last post by:
I'll pulling my hair out on this one and would be so appreciative of any help. I am creating a data entry form to enter results of a student survey. There are 40 questions on the survey. The...
0
by: koonda | last post by:
Hi all, I have a Project due after one week. It is a web service project. I have a Web Form which communicates to the web service and this web service communicates to the database. I have all my...
4
by: prosad | last post by:
hello, Just solved a problem using Javascript onclick, can click on any cell in a dynamic table and it will pass the innerText object value to my form text field. parts of code given below: ...
3
by: davenumber40 | last post by:
I’m creating a small database in Access 2003(XP) to track issues during software testing. As far as databases go, it’s going to be a relatively small, short term project (No more than 20,000 records...
14
anfetienne
by: anfetienne | last post by:
hi this question is linked to this post ive made in the mysql section. http://bytes.com/topic/mysql/answers/871536-populating-table#post3499253 simply i want to use a form to populate a table...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...
0
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.