Go Back   CodingForums.com > :: Server side development > PHP

Before you post, read our: Rules & Posting Guidelines

Reply
 
Thread Tools Rate Thread
Enjoy an ad free experience by logging in. Not a member yet? Register.
Old 01-23-2013, 01:36 PM   PM User | #1
tomaz42
New to the CF scene

 
Join Date: Jan 2013
Posts: 9
Thanks: 2
Thanked 0 Times in 0 Posts
tomaz42 is an unknown quantity at this point
Question Saving Webpage Results

Hi all,

Let me start off by saying I'm really sorry if this thread is in the wrong place but I really don't know where it should be.

I'm currently learning web development and I'm stuck try to save results of a random generator on a webpage so that I can use the results on another page. I don't expect anyone to code anything for me, just to help me in the right direction. What should I learn in order to be able to do this? I assume this falls under server side processing?

Thanks for your help,
Tom.
tomaz42 is offline   Reply With Quote
Old 01-23-2013, 01:47 PM   PM User | #2
mlseim
Master Coder

 
mlseim's Avatar
 
Join Date: Jun 2003
Location: Cottage Grove, Minnesota
Posts: 9,046
Thanks: 8
Thanked 1,029 Times in 1,020 Posts
mlseim has a spectacular aura aboutmlseim has a spectacular aura aboutmlseim has a spectacular aura about
What is the random generator?
Numbers, text?

Can you give us an example and some links if you have them?
mlseim is offline   Reply With Quote
Old 01-24-2013, 01:10 AM   PM User | #3
tomaz42
New to the CF scene

 
Join Date: Jan 2013
Posts: 9
Thanks: 2
Thanked 0 Times in 0 Posts
tomaz42 is an unknown quantity at this point
What it's basically doing is creating pairs out of a group of 10. It is showed in a table on the page if that helps at all.

Thanks.
tomaz42 is offline   Reply With Quote
Old 01-24-2013, 12:11 PM   PM User | #4
mlseim
Master Coder

 
mlseim's Avatar
 
Join Date: Jun 2003
Location: Cottage Grove, Minnesota
Posts: 9,046
Thanks: 8
Thanked 1,029 Times in 1,020 Posts
mlseim has a spectacular aura aboutmlseim has a spectacular aura aboutmlseim has a spectacular aura about
Show us the webpage with the table of pairs.
mlseim is offline   Reply With Quote
Old 01-24-2013, 05:05 PM   PM User | #5
tomaz42
New to the CF scene

 
Join Date: Jan 2013
Posts: 9
Thanks: 2
Thanked 0 Times in 0 Posts
tomaz42 is an unknown quantity at this point
At the moment it's local, but it is exactly how you would imagine it, a table choosing pairs from an array and pairing them together into a table of array values.

I would like to be able to store these values into a tables and call them when a different page loads.

Thank you.
tomaz42 is offline   Reply With Quote
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,046
Thanks: 8
Thanked 1,029 Times in 1,020 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
Reply

Bookmarks

Tags
form, results, save, saving, server-side

Jump To Top of Thread


Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT +1. The time now is 02:29 PM.


Advertisement
Log in to turn off these ads.