Fix sql query for register api user

API User Creation test - Sucessful
This commit is contained in:
Arctic Code 2013-07-26 22:52:42 -05:00
parent 7b4d4da8f6
commit 17be9fd2f0

View File

@ -299,10 +299,11 @@ class api{
}
if($canRegAPI != 1) return 'You are not authorized to register to use the API';
$theapikey = '';
// I don't really like this code - Basically I need to check if a generated key is totally unique and generate a new one if it isn't
$sql = "SELECT * FROM `users`";
if(!$result = $apidb->query($apisql)) return 'ERROR: ['.$apidb->error.']';
$theapikey = '';
if(!$result = $apidb->query($sql)) return 'ERROR: ['.$apidb->error.']';
while($row = $result->fetch_assoc()){
$theapikey .= $row['key'].'-';
}