Discussion Forums  >  Plugins, Customizing, Source Code

Replies: 12    Views: 148

BuzzMkt
Apple Fan
Profile
Posts: 131
Reg: Apr 10, 2011
Italy
2,710
11/20/12 09:57 AM (13 years ago)

Send score from Quiz to Sql Database

I need to send Scoreboard to SQL database: I create the DB, the table with this code: "CREATE TABLE tbl_app_quiz_scores ( id int(11) NOT NULL auto_increment, guid varchar(50) collate utf8_unicode_ci default NULL, appGuid varchar(50) collate utf8_unicode_ci default NULL, screenGuid varchar(50) collate utf8_unicode_ci default NULL, userGuid varchar(50) collate utf8_unicode_ci default NULL, userDisplayName varchar(50) collate utf8_unicode_ci default NULL, deviceId varchar(75) collate utf8_unicode_ci default NULL, deviceModel varchar(75) collate utf8_unicode_ci default NULL, deviceLatitude float default NULL, deviceLongitude float default NULL, totalPoints float default NULL, totalSeconds float default NULL, numberQuestions int(11) default NULL, numberCorrect int(11) default NULL, numberIncorrect int(11) default NULL, dateStampUTC datetime default NULL, PRIMARY KEY (id) ) ENGINE=MyISAM DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci; " - I fill my credentials in a file called quiz.php and saved into my server. - i add the url (where i have my quiz.php uploaded) to the quiz screen into Buzztouch - I build the app, tried the quiz but at the end the Sql was not update! What's wrong?Thk
 
ictguy
Aspiring developer
Profile
Posts: 564
Reg: Jun 17, 2011
Mildura, Austra...
15,840
like
11/20/12 03:24 PM (13 years ago)
Are you using the the quiz scoreboard from here? https://www.buzztouch.com/appdata/sample-scoreboard.txt Looks like your are ... Are there any errors in your mysql error logs or even your php error logs? I assume the script is running on the server same server as the mysql? If it's not you may have to adjust your permissions, just a thought! Let us know how you go.
 
BuzzMkt
Apple Fan
Profile
Posts: 131
Reg: Apr 10, 2011
Italy
2,710
like
11/21/12 01:26 AM (13 years ago)
no log errors....other ideas?thk ictguy
 
BuzzMkt
Apple Fan
Profile
Posts: 131
Reg: Apr 10, 2011
Italy
2,710
like
11/21/12 01:34 AM (13 years ago)
..but if i write the url www.mydomain.com/quiz.php this written on the screen {"invalid":"request"}
 
BuzzMkt
Apple Fan
Profile
Posts: 131
Reg: Apr 10, 2011
Italy
2,710
like
11/21/12 03:41 AM (13 years ago)
I tried with php my admin and Sql database but no way. Have you an other solution? (file .php hosted by hostgator)
 
ictguy
Aspiring developer
Profile
Posts: 564
Reg: Jun 17, 2011
Mildura, Austra...
15,840
like
11/21/12 04:21 AM (13 years ago)
Hi Again, I haven't set up this script before but you'll notice that it is expecting a number of variables after the script name. Perhaps that's why you are getting the invalid request error. Trying adding the variables after the ? in your php script and sending it to the url eg... http://www.domain.com/appdata/sample-scoreboard.php?command=getQuizScoreboardData&appGuid=[buzztouchAppId]&apiKey=[buzztouchAPIKey]&screenId=[screenId]&deviceModel=[deviceModel]&deviceLatitude=[deviceLatitude]&deviceLongitude=[deviceLongitude] And notice that error is right at the bottom of the php file .... which basically says do all this stuff else "invalid request" And notice that your are not getting any of the other error messages like "Oops, something went wrong while trying to select the database?" So you are not even getting to the first step. Hope this gets you a bit further. cheers
 
BuzzMkt
Apple Fan
Profile
Posts: 131
Reg: Apr 10, 2011
Italy
2,710
like
11/21/12 06:30 AM (13 years ago)
Hi ictguy, In my case the domain is www.mai-dire.com and the file "quiz.php" I set this url in BT?....what on my php script? http://www.mai-dire.com/quiz.php?command=getQuizScoreboardData&appGuid=[buzztouchAppId]&apiKey=[buzztouchAPIKey]&screenId=[screenId]&deviceModel=[deviceModel]&deviceLatitude=[deviceLatitude]&deviceLongitude=[deviceLongitude] In this way doesn't work....but maybe i forget some steps...
 
ictguy
Aspiring developer
Profile
Posts: 564
Reg: Jun 17, 2011
Mildura, Austra...
15,840
like
11/21/12 02:44 PM (13 years ago)
The idea is that the parts inside the brackets [] are the actual variables from the device. So it's sending the real app id, the api key etc ...
 
BuzzMkt
Apple Fan
Profile
Posts: 131
Reg: Apr 10, 2011
Italy
2,710
like
11/23/12 01:21 AM (13 years ago)
Hi mr ictguy, I try your suggestions but with bad results...really i don't know why.....I don't know if it is possible but i want ask you if you could have a look into my file and sql... if it is possible write me to [email protected] i will send you all the login information....thk in advance for your patience.
 
Derval
Aspiring developer
Profile
Posts: 364
Reg: Sep 20, 2012
Milan
17,240
like
11/27/12 09:16 AM (13 years ago)
I was interested to read these posts because I am currently trying to do a similar thing: at the end of the quiz on my app, I want users to be able to upload their results to FB. I asked David about it on a recent Webinar and he explained by showing some of the code and suggested contacting oDesk if I didn’t know PHP and pay someone to write it. This is what I did (I didn’t realize David had written the code already and it was available here - perhaps it is different?). However, it is still not working properly (I am hoping the engineer will figure it out), but maybe, just maybe, it is a step closer than @BuzzMkt, and maybe you guys can figure out the problem. At this dropbox address you will see a screen shot of what I get when I try to give the user the option to post to Facebook plus the PHP code I got from oDesk. <a href="https://www.dropbox.com/sh/3zwe2tioh0esmdc/6CQB-U85PY" target="_blank" rel="nofollow">https://www.dropbox.com/sh/3zwe2tioh0esmdc/6CQB-U85PY</a> As you will see from the screenshot, it logs into my Facebook page, is ready to post a link, but it doesn’t have my quiz results. Any thoughts on this? Can you figure out what the problem is? Can it also help you, @BuzzMkt?
 
BuzzMkt
Apple Fan
Profile
Posts: 131
Reg: Apr 10, 2011
Italy
2,710
like
11/28/12 01:11 AM (13 years ago)
Ciao Dervalo, vedo che sei di Milano...sinceramente io non ho risolto il mio database non prende i dati...se trovi la soluzione fammi sapere grazie...
 
ictguy
Aspiring developer
Profile
Posts: 564
Reg: Jun 17, 2011
Mildura, Austra...
15,840
like
11/28/12 01:38 AM (13 years ago)
Sorry guys, but I just haven't got the time for this one at the moment. And I'm not sure if I have the skills too - Installing scripts - ok. Writing PHP not so good :( Hopefully someone else will chime in with some more info ...
 
Derval
Aspiring developer
Profile
Posts: 364
Reg: Sep 20, 2012
Milan
17,240
like
11/28/12 01:44 AM (13 years ago)
che frustrazione! certo :-) vedo che @kittsy sta sviluppando uno plugin al riguardo… Ecco il php documento che mi hanno fatto, però non mi da ancora i risultati che cercavo… ti tengo aggiornato comunque si trovo una soluzione per fare funzionare questo documento come doveva.. https://www.dropbox.com/sh/3zwe2tioh0esmdc/6CQB-U85PY ______________________________________________________________ how frustrating! I see that @kittsy is developing a plugin in this area which may be able to help us. Here is the php document that I had made but it does not yet produce the results I was looking for. I’ll keep you posted if I manage get this php document to do what it is supposed to do. ciao da Milano dove piove cats and dogs!!
 

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.