View Single Post
Old 01-24-2013, 08:18 PM   PM User | #6
mlseim
Master Coder

 
mlseim's Avatar
 
Join Date: Jun 2003
Location: Cottage Grove, Minnesota
Posts: 9,055
Thanks: 8
Thanked 1,032 Times in 1,023 Posts
mlseim has a spectacular aura aboutmlseim has a spectacular aura aboutmlseim has a spectacular aura about
Let's clear-up the word "table".
I think you're talking about HTML <table> <tr> <td> .... etc.
I'm assuming your PHP script generates a page with <table> and displays the pairs?
That's fine ... but when it comes to saving the pairs, I'm talking about MySQL 'table'.
I sure wish the term "table" was not used in two different ways.

You'll create a MySQL table, call it something like "pairs".

Create some columns....

row_id | pair_id | left_value | right_value |

When a page <table> is created, you'll have given that set of pairs some unique name or id so each row in the MySQL table will have the same name (some id value for pair_id) for each pair. As your PHP script generates the <table> on your web page, you can write each pair to a row (INSERT) into your MySQL table called "pairs".

Your MySQL table called "pairs" will possibly become quite large depending on how many pairs you are generating. You didn't provide that information.

On any other page, you only need to know the id number of the set of pairs you are looking for. You'll query your database and grab all of the pairs for any given 'pair_id'.

Without seeing any PHP on how your <table> is generated, I'm just throwing out ideas. I guess I would say, "it's exactly how you imagine it".



.

Last edited by mlseim; 01-24-2013 at 08:21 PM..
mlseim is offline   Reply With Quote