Jump to content

extracting data from table


1414mark1414

Recommended Posts

$con = mysql_connect("localhost","my_username","my_pass");if (!$con)  {  die('Could not connect: ' . mysql_error());  }mysql_select_db("my_db", $con);$queryy = 'SELECT * FROM ' . $_Get['table']; $resultt = mysql_query($queryy);$roww = mysql_fetch_array($resultt); $Name= $roww[1];

Basically I have a form where a person selects from what table the data will be extract fromBut for some reason the code above shows error

$queryy = 'SELECT * FROM ' . $_Get['table'];

Link to comment
Share on other sites

GET is in capitals -

$queryy = 'SELECT * FROM ' . $_GET['table'];

You should also use mysql_real_escape_string() on the variable.

Link to comment
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...