1
0
mirror of https://github.com/cydrobolt/polr.git synced 2024-11-10 04:02:28 +01:00

Update api.php

This commit is contained in:
Cydrobolt 2014-03-09 08:03:32 -04:00
parent 7a1f4b80db
commit 2ac5efc7dd

View File

@ -1,8 +1,6 @@
<?php <?php
//API CONFIGURATION BELOW //API CONFIGURATION BELOW
//no vars yet
//POLR API - by http://github.com/cydrobolt/polr //POLR API - by http://github.com/cydrobolt/polr
require_once('req.php'); //Fetch Config require_once('req.php'); //Fetch Config
@ -18,9 +16,9 @@ else {
//checking API key: //checking API key:
$query = "SELECT valid FROM api WHERE apikey='$apikey'"; $query = "SELECT valid FROM api WHERE apikey='$apikey'";
$result = $mysqli->query($query) or showerror(); $result = $mysqli->query($query) or showerror();
$numrows = $result->num_rows; $row = mysqli_fetch_assoc($result);
//check if valid //check if valid
if(!$numrows) { if(!$row['valid']) {
$api_key_valid = 0; $api_key_valid = 0;
} }
else { else {