2016-02-02, 10:25 PM
Hello.
My question and problem is ¿How to use this consult in mybb?
Example of the result: 25
I tried this and it doesn't work:
Result:
Sorry for my bad english.![Blush Blush](https://community.mybb.com/images/smilies/blush.gif)
My question and problem is ¿How to use this consult in mybb?
$consulta2= "SELECT (COUNT(*) + 1) AS rank FROM table WHERE scorem > ".$score." OR scorem = ".$score." AND tiempo > ".$tiempo_jugador;
$resultado2= mysql_query($consulta2, $conex) or die (mysql_error());
$rank = mysql_fetch_array($resultado2);
echo $rank[0];
Example of the result: 25
I tried this and it doesn't work:
global $db;
$query = $db->query("SELECT (COUNT(*) + 1) AS rank FROM table WHERE scorem > ".$score." OR scorem = ".$score." AND tiempo > ".$tiempo_jugador);
$rank = fetch_array($query);
echo $rank[0];
Result:
MyBB SQL Error - [20] array ( 'error_no' => 1064, 'error' => '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 \') OR scorem = () AND tiempo > ()\' at line 1', 'query' => 'SELECT (COUNT(*) + 1) AS rank FROM sv_fun_maps WHERE scorem > () OR scorem = () AND tiempo > ()', )
Sorry for my bad english.
![Blush Blush](https://community.mybb.com/images/smilies/blush.gif)