1414mark1414 Posted August 5, 2008 Share Posted August 5, 2008 $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 More sharing options...
Synook Posted August 5, 2008 Share Posted August 5, 2008 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 More sharing options...
1414mark1414 Posted August 5, 2008 Author Share Posted August 5, 2008 oh oh yeah I know it's in capitals lol but even with capitals it doesn't work it shows errorNvm I got it Link to comment Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.