I am trying to insert into a mySql table, the tables name is the result of a sql select query, the first query returns the correct result but the second query is where the error seems to lie, any help would be very very much appreciated
$query = mysql_query("SELECT council from users where username = '$username'");
$x = mysql_result($query,0, "council");
$councilArea = (string)$x;
// mysql inserting a new row
$result = mysql_query("INSERT INTO '$councilArea' ('barcode', 'productname', 'bin', 'info', 'addedby') VALUES('$barcode', '$productname', '$bin', '$info', '$username')");