DataBase Connectivity on the client side using (JavaScript) - javascript

I have a question which really Poked me for several days... I have came across a hurdle, the problem is that i need the Php application on the server side and the database to be on the client side... and the application should communicate with each other very nicely..
Javascript was the best option coming in my mind... The problem is that i dont have any idea how do i make this thing applicable...
If any one have any knowledge for that please share that stuff with me...
Thanks in advance...

Your question is kind of generic, so i can't determine whether you REALLY need a database stored on the client-side, and why. However if that is what you truly desire, HTML5 has client-side storage capabilities which can be used for running apps locally in the browser without having to pass data back to the server:
Some background and usage
Tutorial

Related

Assistance using SOCKET.IO to connect a JAVA Client and a HTML/JAVASCRIPT Server

I'm working on a JAVA system that needs to pass a string over to a website so that the website can display it in the of it. I've done some research and for my issue the SOCKET.IO extension seems to be the solution but I can't seem to get it working on the website end. (Using https://socketio.github.io/socket.io-client-java/emitting_events.html on the JAVA end, mainly following the template) I'm not very good with website setup so I don't know the best way to set up the server side in JAVASCRIPT, is there any way I could please get assistance setting it up via my localhost:3000? As far as I know, the HTML/CSS doesn't really matter here as it's all done via the JAVASCRIPT so I don't think I need to show that, but feel free to ask for it. (I have no JAVASCRIPT written currently, I tried a bit but it was a mess)
Thank you for any help that can be provided, I know it's a bit specific.

server-side AI for web application

sorry if this question sounds kinda weird, but I haven't managed to get a satisfying answer yet.
The thing is, I am making( or willing to make ) a web-browser based game where people have their own company, trade, build etc.. And the game will also include bots. Because there will be quite a lot happening, it would be good for the bots to run at all times and react to various situations.
But.. I don't know how to make it happen server-side. Is there a way to make a script run on a server (like VPS)? Or is there a way to make some kind of application that would run on the server and communicate with the database and send answers?
Thank you :)
Of course there is a way to do this server-side - you "just" have to create a server, using any language/framework/platform that enables you to create a proper server application (this could be C++, Java, you could even stay in the JavaScript realm by using Node.js).
You would have to provide some kind of communication channel between web clients and your server. For that, you could use either Websockets (TCP) or WebRTC (UDP), simple AJAX could be an option too, but I wouldn't recommend it for persistent communication channel.

2 way communication using HTML and Javascript?

I've been looking for a while for a simple solution to what seems like a relatively simple problem, but I just cannot for the life of me manage to find it.
So here is what I am trying to do:
Server (Hosting an HTML file, Has a variable, x, which is a javascript variable)
Server is running on my local network (192.168.x.x, with no security)
Client, PC, has access to SSH, Telnet, whatever, and wants to communicate over TCP/IP
So my question is this: How can I get the client to send a value, over TCP/IP, to the server, changing the value of that variable?
I can see that there are rather complex ways to do this, using websockets, sockJS, and other complex solutions, but if anyone knows of a super simple way to do this, please let me know.
Thanks :)
You'll want to use sockets. I'd recommend socket.io http://socket.io/

Call server side C++ from webpage

I would like to use node.js/express and socket.io to retrieve data off of a piece of hardware through a web browser, but I really dont know where to start. I currently have express serving a webpage. I would like to retrieve and display raw data in realtime (graph form) from a sensor, for this reason, socket.io looked promising. I would also need to use some server side code (c, c++?) to do some processing on this data and display the results on the page. Is Ajax the best way to do this?
I do not really have much experience with this sort of thing, so is this the best way to go about this? Better options?
you can use web sockets and this c++ library. http://libwebsockets.org
and there is pretty example of its usage. http://martinsikora.com/libwebsockets-simple-http-server

Best Way to Transfer Data to and from a MySQL Database

I wonder whether someone may be able to help me please. For a while now I've been working on the Javascript and HTML elements of the Google Maps V3 api. I now want to look at how I'm going to transfer the data to and from MySQL database.
I've read quite a lot of documentation on the Internet on the various methods of transferring this information but I'm not too sure of the best route to take.
I just wondered whether it would be possible that someone with a lot more experience than I could perhaps give me a bit of advice and direction please on the best way to transfer this data.
Many thanks and kind regards
it's a fairly broad question, but mostly dependent on your implementation. Are you already interfacing with the API using a server side language, or just all with Javascript? If everything is being done on the client side, then you would want to consider some sort of AJAX/form functionality to get the data from the client to a server side script. If you are doing any of this on the server side, then you can cut out the AJAX middle man and run SQL commands via PHP or whatnot as you are interfacing with the API.
I would recomend MySQl Dump. Its fairly simple and there is plenty of documentation on how to do it.

Categories