anonymous
2010-12-15 05:45:12 UTC
"Error: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '''' at line 1"
If I do not check for the error the code will run and display the table but If I do not select a table it will produce the following statements.
Warning: mysql_num_fields(): supplied argument is not a valid MySQL result resource on line 33
Warning: mysql_fetch_array(): supplied argument is not a valid MySQL result resource on line 39
My Code:
$selectedRadio = $_POST[options];
$sql = "SELECT * FROM '$selectedRadio'";
//$q = $db->query($sql) or die("SELECT Error: ".mysql_error());
$result = mysql_query($sql); //or die ('Error: '.mysql_error ());
//$r = $q->numRows();
echo "
". mysql_field_name($result, $i) . " | ";
---|
$data | ";
echo "Table not displayed";
Does anyone know what I'm doing wrong?