I have a very strange issue with PHP.
I run this very simple code:
include("db_credentials.php");
//
$conn = mysql_connect($host, $user, $pass);
$sel = mysql_select_db($db, $conn);
//
$result = mysql_query("SELECT * FROM tokens");
$res = mysql_num_rows($result);
//
echo (50000-$res);
but the final subtraction result is NEVER right. I tried echo gettype($res) and $res is an integer (what else could it be?), but I have no idea of what could cause this. Is it a PHP bug? Is there something wrong with my code?
I’m pretty sure I’ve run into this before but can’t remember exactly where or how.
This isn’t an answer per say, but rather a suggestion.
Try this code instead