473,399 Members | 3,106 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,399 software developers and data experts.

How to Dynamically Create a Table from Data in another Table

Looking for a start on how to accomplish my goal of enhancing our current database. We currently take in data then call that data to web pages to view details using PHP. Since the data is from survey interviews, I want to create tables based on each study name and place all complete survey data pertaining to each study in the applicable table. Then, call data from these tables via PHP. Number of columns varies from study to study. Since each week study names are different, I would like to dynamically create the table for each study when the first data for that study hits the database. Is this possible? If so, how would I go about starting to do something like this? Thanks in advance.

wayneray
Nov 6 '06 #1
3 4130
ronverdonk
4,258 Expert 4TB
Looking for a start on how to accomplish my goal of enhancing our current database. We currently take in data then call that data to web pages to view details using PHP. Since the data is from survey interviews, I want to create tables based on each study name and place all complete survey data pertaining to each study in the applicable table. Then, call data from these tables via PHP. Number of columns varies from study to study. Since each week study names are different, I would like to dynamically create the table for each study when the first data for that study hits the database. Is this possible? If so, how would I go about starting to do something like this? Thanks in advance.

wayneray
I still cannot clearly see what you want to do here. Like "we currently take in data that call to web pages..." and "I want to create tables...".
How do you take in that data? In a file, in another table (as I presume from the thread title), in special format, such as XML or CSV, how?
And when it is already in a table, why would uou want to create another one with the same data?

And, can you, from that data stream (let's call it that) deduct column names and data types for the table to be created?

In short, I have too many questions on this. Please elaborate a bit more.

Ronald :cool:
Nov 7 '06 #2
Sure,

Sorry I did not explain well. We take in text files from client computers and populate a table with the data. Each field of data in this table is tied to a specific GUID. We use PHP code that loops through the table and builds dynamic html tables. We average well over 750 K rows of data on any given weekend. You can imagine the speed of some of these web pages. I would like to build temporary tables dynamically in the database, then use PHP directed at these dynamic tables. While I am growing very fond of MYSQL, I am not sure how to start the process of dynamic tables.

After the studies are done, we delete the dynamic tables. There will be new dynamic tables each week. At no time will we ever exceed 50 tables including the permanent tables.

Wayneray
Nov 7 '06 #3
ronverdonk
4,258 Expert 4TB
I am still poking around in the dark on this, but let me make some assumptions.
  • You have one table that holds all survey results (presumably in text format),
  • Each column in that table holds all data of 1 survey only (text format),
  • You already have a PHP program that extracts data from that column and builds HTML tables/screens.
  • At the end of this program you have extracted, and know, item name and item-content of each item/question/subject of that survey.
  • You want to dynamically build a table (one for each survey) that:
    • has the item name as column name
    • has the item content as column content
  • You want to generate PHP code that can handle that particular table (CRUD code?)

Ronald :cool:
Nov 9 '06 #4

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

Similar topics

4
by: petermichaux | last post by:
Hi, I am interesting in using PHP to dynamically create an XML document and then use XSLT to transform to XHTML. I have come across two methods for doing this. I made two equivalent examples so...
3
by: Kiyomi | last post by:
Hello, I create a Table1 dynamically at run time, and at the same time, I would like to create LinkButton controls, also dynamically, and insert them into each line in my Table1. I would...
4
by: Bas Groeneveld | last post by:
I am developing an ASP.NET application part of which consists of a data entry wizard defined by entries in a data table - ie the controls on each page of the wizard are determined by definitions in...
4
by: Grigs | last post by:
Hello, I have an asp:table on my page. I am, after a button gets clicked, programmatically adding rows and their cells. Using the Cell.Text = to put the value in the cell. I then have another...
19
by: matt | last post by:
I've seen several posts that begin to address this problem, but have not found a simple, elegant solution that will accomplish this goal. The important part of this solution is that it must be...
3
by: rn5a | last post by:
A SqlDataReader is populated with the records from a SQL Server 2005 DB table. The records retrieved depends upon 2 conditions (the conditions depend on what a user selects in an ASPX page). If...
4
by: m.wanstall | last post by:
I have a crosstab query that compiles data for Months of the year. I have a stacked select query on top of that crosstab query that uses the latest 2 months data and exports it to a fixed length...
4
by: mohaaron | last post by:
I can think of a lot of reasons why this might need to be done but as far as I can tell it's not possible. I've been looking for a way to add HtmlTableRows to a table using a button click for a...
2
by: ssmith147 | last post by:
Hi, I'm somewhat familiar with access and vb programming (I can read someone else's code, for the most part), but I'm still very green when it comes to creating solutions for my own needs. I'm...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
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
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...

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.