I wanted to fetch result from mysql database with the table name set to a session variable but it not working, here is the error message."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"
PHP variable
5
I wanted to fetch result from mysql database with the table name set to a session variable but it not working, here is the error message."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"
<?php
session_start();
$subject1=$_SESSION['subject1']='mathematics';
function getsubject1(){ global $subject1;
$questions=mysql_query("select * from $subject1 ") or die(mysql_error());
while($quest=mysql_fetch_array($question)){
echo $quest['question']; } }
?>
' at line 1"
<?php
session_start();
$subject1=$_SESSION['subject1']='mathematics';
function getsubject1(){ global $subject1;
$questions=mysql_query("select * from $subject1 ") or die(mysql_error());
while($quest=mysql_fetch_array($question)){
echo $quest['question']; } }
?>
- christogonus
- KirkMcD
- [1] reply
- heroecitadel
- christogonus
Next Topics on Trending Feed
-
5