I don't have the link on hand, but if you search a little bit, there is a subject somewhere here about this. Basically, mysql support isn't working for most people and no word on a fix.
The only answer for now is some sort of workaround, like an http from ape server or an Ajax request client side. I used the last one on my app and some caching during connection. - Louis Envoyé de mon iPhone Le 2011-11-12 à 19:15, O_M3_ <[email protected]> a écrit : > My script: > > Ape.registerCmd("addMensagem", false,function(params, infos) { > > var sql = new Ape.MySQL("127.0.0.1:3306", "usuario", "test", > "radiov3"); > > sql.onConnect = function() { > Ape.log('Connected to mysql server'); > } > > sql.onError = function(errorNo) { > Ape.log('Connection Error : ' + errorNo + ' : '+ > this.errorString()); > > } > > sql.query("INSERT INTO ouvintesChatMsgs VALUES('a','b','c')", > function(res, errorNo) { > if (errorNo) Ape.log('Request error : ' + errorNo + ' : '+ > this.errorString()); > else Ape.log('Inserted'); > }); > > return {"name":"om3","data":{"value":"ok"}}; > }); > > > ###################################### > > My output: > > root@svr03 [/usr/local/APE_Server/bin]# ./aped > _ ___ ___ > /_\ | _ \ __| > / _ \| _/ _| > /_/ \_\_| |___| > AJAX Push Engine > > Bind on port 6969 > > Version : 1.1.2-dev > Build : Nov 12 2011 21:15:18 > Author : Weelya ([email protected]) > > [Module] [spidermonkey] Loading module : Javascript embeded (0.01) - > Anthony Catel > [JS] Loading script ../scripts/framework/mootools.js... > [JS] Loading script ../scripts/framework/Http.js... > [JS] Loading script ../scripts/framework/userslist.js... > [JS] Loading script ../scripts/utils/utils.js... > [JS] Loading script ../scripts/commands/proxy.js... > [JS] Loading script ../scripts/commands/inlinepush.js... > [JS] Loading script ../scripts/examples/nickname.js... > [JS] Loading script ../scripts/examples/move.js... > [JS] Loading script ../scripts/utils/checkTool.js... > [JS] Loading script ../scripts/mysql.js... > ../scripts/mysql.js:17:TypeError: sql.query is not a function > > > On Nov 12, 6:25 am, O_M3_ <[email protected]> wrote: >> I'm getting this: TypeError: sql.query is not a function >> >> ------ >> gcc -D_GNU_SOURCE -Wall -g -minline-all-stringops -rdynamic -I ./deps/ >> udns-0.0.9/ src/entry.c src/sock.c src/hash.c src/handle_http.c src/ >> cmd.c src/users.c src/channel.c src/config.c src/json.c src/ >> json_parser.c src/plugins.c src/http.c src/extend.c src/utils.c src/ >> ticks.c src/base64.c src/pipe.c src/raw.c src/events.c src/ >> event_kqueue.c src/event_epoll.c src/event_select.c src/transports.c >> src/servers.c src/dns.c src/sha1.c src/log.c src/parser.c src/md5.c -o >> bin/aped -ldl -lm -lpthread ./deps/udns-0.0.9/libudns.a -I ./deps/ >> udns-0.0.9/ >> gcc -D_GNU_SOURCE -Wall -g -shared -fPIC -rdynamic -Wl,- >> soname,libmod_spidermonkey.so -o lib/libmod_spidermonkey.so libape- >> spidermonkey.c -I../deps/js/src/dist/include/ -L../deps/js/src/ - >> ljs_static -lstdc++ -L./deps/mysac/ -I./deps/mysac/ -lmysac - >> lmysqlclient_r >> root@svr03 [/usr/local/APE_Server]# cd bin >> root@svr03 [/usr/local/APE_Server/bin]# killall aped >> root@svr03 [/usr/local/APE_Server/bin]# ./aped >> root@svr03 [/usr/local/APE_Server/bin]# ../scripts/om3/mysql.js: >> 11:TypeError: sql.query is not a function >> root@svr03 [/usr/local/APE_Server/bin]# ls /usr/lib/ | grep >> mysqlclient_r >> libmysqlclient_r@ >> libmysqlclient_r.so@ >> libmysqlclient_r.so.15@ >> libmysqlclient_r.so.15.0.0* >> mysqlclient_r@ > > -- > You received this message because you are subscribed to the Google > Groups "APE Project" group. > To post to this group, send email to [email protected] > To unsubscribe from this group, send email to > [email protected] > For more options, visit this group at > http://groups.google.com/group/ape-project?hl=en > --- > APE Project (Ajax Push Engine) > Official website : http://www.ape-project.org/ > Git Hub : http://github.com/APE-Project/ -- You received this message because you are subscribed to the Google Groups "APE Project" group. To post to this group, send email to [email protected] To unsubscribe from this group, send email to [email protected] For more options, visit this group at http://groups.google.com/group/ape-project?hl=en --- APE Project (Ajax Push Engine) Official website : http://www.ape-project.org/ Git Hub : http://github.com/APE-Project/
