I'm currently developing an application in flash that requires me to save data into a remote MySQL database. I use a PHP page to send and receive data from the database and it works fine. However, new updates from the database are not fetched by the PHP page requested by my flash app, even if I reload it. It's like receiving the same old data over and over again. What could possibly wrong with my processes? Can there be a simpler way to access a MySQL through Actionscript without the use of PHP? Thanks!
Check the query in the php page (attach it)
Emulate the request without using Flash - use your browser or a network debug proxy like Charles and see what you get
Are you using Zend_Amf ?
Using flash to directly access a database is something unusual (to me at the very least). It would require authenticating the Flash application against the database server, sending queries up to it and developing a way of parsing the results. It doesn't make things any simpler and adds a great deal of concerns.
Related
On my project, I'm using a php site for getting data from sql server.
My android app connect the php site and send values , php site take values with POST method, and get the intended values from sql, after that, write in a html div(has an id), and last my app get data from html div with jsoup parser.
This way is working correctly, I'll ask about performance, when I Googled I saw a library called jdbc, so if I connect my app directly to sql server, is it get less loading time, or my way is true?
Sorry for my bad English :(
when I Googled I saw a library called jdbc, so if I connect my app directly to sql server
You can connect your app to sql server as long as sql server is accessible from Internet or your app has access to a network where sql server is accessible.
is it get less loading time
You can expect far better response time because you won't need the php site anymore as long as your JDBC code is well written.
As the question says, is it possible to interact with a MySQL database created with XAMPP (so, using PhpMyAdmin) without using PHP, but only Javascript/JQuery?
This is a merely theoretical question, I don't want to know how to (but if you know it, I want discard your help).
With this, I don't mean using Ajax to send my request to a .php page that will then interact with the database, but directly interacting without passing through PHP.
In terms of a PHP application, it's not possible to interact with MySQL through JavaScript because JavaScript is executed client side i.e in the browser, it doesn't have access to anything on the server it is being served from.
However, with nodejs - a JavaScript runtime built on Chrome's V8 JavaScript engine - you can write a complete JavaScript server side application without having to touch PHP. There's a node-mysql module which means you can interact with a MySQL database with JavaScript code.
Several web application frameworks exist to help you get something up and running like Express, which saves you the burden of having to write up things like routing logic.
No you can't interact with MySQL through JavaScript or JQuery. You could use JavaScript and JQuery through your PHP pages if that would be a functionality you'd be interested in. You could also use another language compatible with MySQL. Otherwise interacting with MySQL straight through JavaScript/JQuery won't work.
You can do openDatabase()
Make an SQL file, db.sql,
and in a javscript file, type this: openDatabase(db.sql, '1.0', 'My First Database', 65535)
More on this here: http://html5doctor.com/introducing-web-sql-databases/.
This makes an SQLite connection. I recommend it as it doesn't use PHP, but if you really really want to use MySQL(Again, I recommend using this SQLite method) you have to use PHP or some sort of server scripting language.
Learn SQLite: https://www.tutorialspoint.com/sqlite/index.htm
This works on:
XAMPP
repl.it
well, basically anything.
I will be developing an smartphone app (eg iOS) in either actionscript 3 with adobe air or using flex. However I need to connect to a database for a huge amount of data storage and retrieval. There is a tonne of information about local database storage, but not on an external server!
I have done some research, most leads me to dead ends or not to be what I need. I have heard that its safer to pass variables to a PHP file which then deals with the database stuff; however how can I send data from the actionscript file over to a server and target php file? I cannot seem to find this anywhere!
At the moment I do not have an code to show, I am trying to find the best solution. Thank you.
I think the best is not to just call php scripts, but to build a php based webservice.
You can achieve that by using AMFPhp
Please check the links below on what you can do and how.
http://cookbooks.adobe.com/post_AMFPHP___Flex_4_demo-16508.html
http://polygeek.com/530_video-tutorial_amfphp-video-tutorial-connecting-to-amfphp-and-returning-data-version-10
http://www.silexlabs.org/amfphp/
I've developed an application that I would like to use meteor.js for real time updates (I want to enhance but not change my program, for example when a user adds a comments make it update in real-time ) . Problem is meteor.js uses node.js (so javascript as server-side code). I use LAMP stack, Is it possible to get PHP to feed data into meteor.js from mysql.
Meteor is more than just an 'interactive webapplication'-builder or javascript framework. The idea is to have only one programming language (besides HTML/CSS for markup) to do all the work. Basically it creates a 'remote server' (in the clients browser) it can push data to and at the same time it publishes various API's to the users system. The data passed through these API's / connections has a specific structure which has to be adhered at all time.
Meteor is built around NodeJS, which makes it hard (if not impossible) to run it without this backend. Sure you can try to mimic the backend using PHP, but it would be a waste of time. Reading your question you'll be better of using a javascript framework like jQuery or Prototype. Unlike Meteor you will need to do the AJAX calls (POST & CallBack) yourself, but you can actually decide which backend you want to use yourself (including PHP / MySQL).
If you want to do this anyway you need to check the Meteor & NodeJS source code to see what the minimum requirements are to make Meteor run under PHP. The PHP stack has to interpret the commands Meteor sends and receivers, but this won't be an easy task.
You can use comet (or reverse ajax) for realtime updates.
Trying to marry node.js with PHP doesn't sound like a worthwhile path to go down. If someone insisted on using a system like Meteor.js, yet with a PHP back-end, it would make more sense to look at AngularJS which is mainly the client side.
Of course, that is different technology stack. If someone really insisted on the blending, one could consider using server side sockets to interact with PHP Web services; and/or use mongodb and/or mysql-node to interact with the same databases.
I released a meteorite package that interacts with a Wordpress site that has the Wordpress JSON API. A quick fix. For now.
Comes with a backend call that will return the raw data, or a publication that stores the posts using their id's instead of a randomly generated mongoid. And some basic templates to get you started including a Session variable that keeps track of the currently selected post.
I'm working on it a lot more and will eventually have a version that directly makes mysql calls from node so you won't need php or Wordpress; just the ability to access the mysql database (which can be remote, with the appropriate configuration, or on the same machine).
I have a simple php page that displays data from a mysql database. I want it to update itself automatically when data gets changed on the server. (I don't want to update the page periodically at fix time intervals.) I guess I need the technology behind FB chat box or omegle. But I don't know how to implement it on php and mysql. I would be grateful if you could help me. Thanks.
You would need to look into WebSockets or a Comet server (which uses long-polling techniques) to accomplish a push system. Alternatively, instead of using push-like notification, you could make frequent polls to the server with nothing more than a request identifier and a timestamp, let the server decide if there is anything new since the last poll, and serve up the data if there is.
you can implement Comet technology which is opposite of Ajax. JavaScript Dojo Toolkit can be useful to handle this method well.
Dojo WebSocket
http://dojotoolkit.org/features/1.6/dojo-websocket
http://cometd.org/
"Comet is a web application model in which a long-held HTTP request allows a web server to push data to a browser, without the browser explicitly requesting it."
http://en.wikipedia.org/wiki/Comet_(programming))