Please, who can help me. The question is this: I need to extract two variables from an array and use them as integer type to compare values between them. The code is this:
$sql = "SELECT *
FROM
inf_user
WHERE
login = '" . $login
."' and senha = '" . $senha ."'";
try{
$conn = new PDO('mysql:host=' . $servername . ';dbname=' . $dbname, $username, $password);
$conn->setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_EXCEPTION);
$result = $conn->query($sql) or die('Nao foi possivel executar o comando.');
$rows = $result->fetch();
extract($rows);
//echo "\$limite = $limite; \$consultas = $consultas";
$limite = intval($limite);
$consultas = intval($consultas);
var_dump($limite);
The return of var_dump
is int(2)
, but I need it to be only the number 2
without int()
. How do I?