Im trying to have my site access a table look at the location where member is from then go and look for the table that matchs that heres what iv got.
[php]$tbl_name=$test[‘location’]; // Table name
$query = “SELECT * FROM members
WHERE username
=’{$_SESSION[‘myusername’]}’” or die($mysqli->error.LINE); //check for usernames location
$userid = $mysqli->query($query) or die($mysqli->error.__LINE__);
while($test = mysqli_fetch_assoc($userid)){
;
$sql=“SELECT * FROM $tbl_name” or die($mysqli->error.LINE); //to look for users database to post inventory
$result = $mysqli->query($sql) or die($mysqli->error.LINE);
;
while($rows=mysqli_fetch_assoc($result)){
;
} }
mysqli_close($mysqli);[/php]
And this is the error im gettings
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 143 (there is no line 143 only gose to 95 lines.)
Please help