Discussion Forums  >  Config Data, JSON, App Refresh

Replies: 2    Views: 164

Dusko
Veteran developer
Profile
Posts: 998
Reg: Oct 13, 2012
Beograd
22,680
Fourm StarFourm StarFourm Star
07/29/13 08:44 AM (9 years ago)

JSON data will NOT show up for any of my apps

I am developing for Android only and have five apps in the Play market created with BuzzTouch. When I click on JSON data, the following shows: An error ocurred in running the fnExecuteNonQuery() method in utilityFunctions.php (6) The only thing I did prior to this error is to delete an option from Menu with Image. The option was created with JSON Snippet Keeper. The same happens when I create a new app, as well as when I try to access the JSON data from a user that is different than admin.
 
Dusko
Veteran developer
Profile
Posts: 998
Reg: Oct 13, 2012
Beograd
22,680
Fourm StarFourm StarFourm Star
like
07/29/13 10:41 AM (9 years ago)
I have found the error and I will publish it here for the benefit of future readers. First I found the place for this error in the fnExecuteNonQuery() function in file utilityFunctions.php. Then I inserted the following PHP lines in order to see what was going on: function fnExecuteNonQuery($theSql, $host, $db, $user, $pass){ echo "-----------------------<br>\n"; echo "-----------------------<br>\n"; echo "<br>" . $theSql . "<br>\n"; echo "<br>" . $host. "<br>\n"; echo "<br>" . $db. "<br>\n"; echo "<br>" . $user. "<br>\n"; echo "<br>" . $pass. "<br>\n"; echo "-----------------------<br>"; $conn = db_connect($host, $db, $user, $pass); ... This gave me a string 381 characters long, starting with INSERT INTO bt_api_requests (guid, appGuid, clientApiKey, ... from which I gathered that there was something wrong with table bt_api_requests. I went into my cpanel, and then into phpMyAdmin and I saw that the SQL statement was correct, at least in the number of parameters and their values. I used the option SQL in the phpMyAdmin for table bt_api_requests, copied the entire string from above, and executing it. It yielded the following error: #1062 - Duplicate entry '72469' for key 'PRIMARY' That was interesting, since the last row in that table was numbered 72468 -- one less than needed. So, the error was that the table itself was somehow broken. Fortunately, phpMyAdmin also offers the option Operations. It contains various options to check the table and then repair. Checking the table, I saw two warnings and two errors -- the table was broken indeed. Now, I applied the option called Repair table, and voila ! -- one row was added into the table... and the JSON was operational again, for all my apps and users. Finally, I removed the PHP code I added into the function and brushed off to create yet another backup of the buzztouch database and of the site itself. A bit of a detective work, I must say. And now for the happy ending -- the option I deleted was also deleted from the app. Since it was in the LIVE mode, the only thing I needed was to rerun the app on my phone and now everything works as I intended.
 
Niraj Shah
buzztouch Evangelist
Profile
Posts: 2942
Reg: Jul 11, 2012
Cerritos
37,920
Fourm StarFourm Star
like
07/30/13 08:17 PM (9 years ago)
Nice detective work, thanks for the story! :-) -- Niraj
 

Login + Screen Name Required to Post

pointerLogin to participate so you can start earning points. Once you're logged in (and have a screen name entered in your profile), you can subscribe to topics, follow users, and start learning how to make apps like the pros.