I want to make a select statement but Its just not working Here's what Im trying to do
SELECT *
from table
WHERE FROM any ROW Pick that $value_id
and indentify the column and display the column_name into a variable
Here's my attempted code:
$id = $_GET['id'];
$sql = mysql_query("SELECT * from table2 WHERE ANYROW_VALUE=$id");
$selected = mysql_fetch_assoc($sql);
$ROW_NAME=mysql_field_name($selected);
Also the id will come up in different COLUMNS so I would like to display all the columns with either do{ or WHILE ... But first I want to find out how can I get this far, thanks!
One thing not to get confused the $id is not a table id is just a numbered value from 1-8000 , also that number can be on the same row but not on the same column , so When I made the table I set each column to unique one more thing , The columns get bigger and bigger as development so it could be 1-50 columns it is why I asked this question it was ok if the column size didn't change but it does so... thanks !
Thankyou all for being here , This is how the table looks like rough sketch : https://i.stack.imgur.com/Rha4C.png