Via a web form, the user selects 2 numbers (drop down) and 2 items (drop down). The numbers selected are to be placed in a table. The two items are selected from a drop down list of 6 choices. The location of those numbers (in the table) is determined by the users selection of item1 and item2. The correlation of item1 and item2 is stored in a mysql database and as described, determined by the users input.
If I put a results table together, such that each cell in the table is a unique $variable, then I can store those variable names as searchable/selectable results in a mysql database. The end result is such that the users choice of items will determine the placement of the two numbers in a table of results.
<?php // other stuff eg, web form, mysql_connect, select_db, etc... leading to $number1 = $_POST['number1']; $querya = mysql_select("SELECT varname FROM table WHERE $item1 = '$item2');// will reaturn a location variable ... $resulta = return($querya, 0); // ... "location1a" or "location2b" or whatever. "$".$resulta = $number1 // This is the part I'm having problems with. ?>
Lets say that the result of the query, for the sake of arguement, is "location2b".
I would like to create a variable name that is determined by the mysql result and then set that variable to whatever $number1 was set to back at the $number1 = $_POST['number1'] so that I can echo the value of $number1 in the appropriate place. For example, a table 6x6 with 36 variables all connectted to the result of the mysql query. The result table looks like... (html removed)
$location1a $location1b $location1c $location1d .... etc ....
$location2a $location2b $location2c $location2d .... etc ....
$location3a $location3b $location3c $location3d ....etc ....
So, for example, if the mysql query returns "location2b" as the result of the query, I would like to be able to echo the value of $number1 in the proper location.
Any thoughts would be appreciated. Even if its to say it can't be done so I can stop trying to figure this out. Thank you!