From 17be9fd2f0596cab35bc04f9d8d639cd2ba6b9c2 Mon Sep 17 00:00:00 2001 From: Arctic Code Date: Fri, 26 Jul 2013 22:52:42 -0500 Subject: [PATCH] Fix sql query for register api user API User Creation test - Sucessful --- api.backend.php | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/api.backend.php b/api.backend.php index 399a466..8fb547c 100644 --- a/api.backend.php +++ b/api.backend.php @@ -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'].'-'; }