Possible Duplicate:
Access array returned by a function in php
The code:
$cnt = mysql_fetch_row(mysql_query("SELECT FOUND_ROWS()"))[0]
Is giving the error:
Parse error: syntax error, unexpected '[' in index.php on line 117
Same for:
$cnt = (mysql_fetch_row(mysql_query("SELECT FOUND_ROWS()")))[0]
This code:
$cnt = mysql_fetch_row(mysql_query("SELECT FOUND_ROWS()"));
$cnt = $cnt[0];
is working fine.
What's going on here?