0

I have multiple identical tables in my database (different content, though) and a table that assigns an Id to every table name. I want to display first the most recent table and the user can navigate between them with two buttons: previous and next. The thing is that I don't know why this doesn't work:

$sql = mysql_query("SELECT MAX('id') AS 'nr' FROM 'listatabele'");
$row = mysql_fetch_array($sql);
$idTabel = $row['nr'];

The error I get is that resource is expected, boolean given.

Michas
  • 7,391
  • 6
  • 38
  • 57
FloIancu
  • 2,619
  • 8
  • 26
  • 34
  • use `mysql_error()` (or, better, `mysqli_error()`) to see why you're not getting the result you expect. – Jerry Feb 18 '13 at 20:24
  • Changed the ` to ' and no success. The mysql_error() says there's a syntax error near "listatabele", check manual. Nothing specific. – FloIancu Feb 18 '13 at 20:28

1 Answers1

0

You could try changing the table name from 'listatabele' to `listatabele`

Brayn
  • 16
  • 2