get browser session in mysql - mysql

How can i get browser session in mysql. Any idea thanks in advance.

You can't get the session information via MySQL as it is only a database and not handling any HTTP stuff.
Fetch the information you need via PHP and then store it from there in MySQL.
http://php.net/manual/en/function.session-id.php

The location of your browser session depends on the framework you use and also on the fact whether you use the db to store your session. Which framework do you use?

Related

Accessing a MySql DB via an IOS application

looking for some advice on a couple of topics.
Im currently starting writing my first IOS application and have some questions.I wish to access some data from a mysql DB - this will hold hold a user table with logins and passwords, etc,...
Can i access the DB directly from IOS and perform my sql queries from within?
What is the standard way of encrypting a cached password for an application?
Is it best practice to perform all the queries from with the app or rely on a web server to proceess these and return the results?
Many thanks, apologies if a little vague but appreciate any constructive feedback guys.
thanks.
Steve
Yes you can access db directly but this isn't ideal. Would be a better idea creating a rest api. Slim framework. Example below:
<?php
$app = new \Slim\Slim();
$app->get('/hello/:name', function ($name) {
echo "Hello, $name";
});
$app->run();
http://www.slimframework.com/
Would do the processing on the server and then just return a json object or xml you can then do what you want with the data.
Encrypting password you could store in keychain only your app will have access.
Can i access the DB directly from IOS and perform my sql queries from within?
reply : this is good pactice .
What is the standard way of encrypting a cached password for an application?
reply: you can use many encrypting , has md5 ,etc
Is it best practice to perform all the queries from with the app or rely on a web server to proceess these and return the results?
reply: yes you can use any webservice , json or xml it best for ios dev with webservice
You can access a database directly from the iOS using the MySQL C API. I haven't got this to work yet, but you can read more about it here: http://zetcode.com/db/mysqlc/
and
http://dev.mysql.com/doc/refman/5.0/en/c-api-function-overview.html
If you don't get it to work then you can indirectly connect to to MySQL via a PHP server. There are lots of these kind of tutorials out there.
Otherwise you could use SQLite that is bult in. But that's almost a different thing.

how to sync data from Mysql to Redis?

My website mostly use Django + Mysql and sometimes Redis for some frequently access data.
My problem is how to sync data from Mysql to Redis automatically when I write data to Mysql by Django admin page.
Thank you for giving me some advice. It also will be appreciated if someone can tell me how to write data into Redis directly by Django admin page
Thank you!
What you want to achieve looks like using Redis as a cache. The pattern is:
Always look for the data in redis
If it's not in redis, get it from MySQL
and store it in Redis with an expiration date, using the expire command
Doing it like this, you have to modify you app, not the admin page. But there could be a delay between the writing of the informations in the admin page, and their availability to the clients.
You may delete the data from the Redis cache in the admin, when storing them, to ensure the newest version will always be delivered. But you will have to modify Django admin page for this.

Asterisk Realtime User Registration

I am using Asterisk Realtime architecture.
I try to dynamically and automatically register user data on my mysql. But i can't set the user info on mysql db.
Thanks.
It is not fully clear what is your issue, but i think this article will solve it
http://www.voip-info.org/wiki/view/Asterisk+RealTime+Sip

Flex multi-client live updates

At work we use amfphp as server and mysql as databse. What we need is that when a user updates a record the other users logged in the application can receive that update and see the update data, is that possible? Are there any libraries capable of doing this? I think that the most important part is to identify from the server the logged in users... thank you in advance.
To make this happen you will need to use a server that supports push functionality; meaning the server can send data to the client.
LiveCycle supports this, as does GraniteDS and WebOrb. I don't think that PHP does.

Flash Media Server + Database Connection? Mysql?

Is there a good way to connect from Flash Media Server 2 to a Database (mysql)?
If not, where does everybody store for example their user data?
The application crashes once per day, so thats why I need to save the important data into a database. And also to validate certain userdata, for example username/password.
Thank you in advance!
If you want to get Flash to a MySQL database I'd recommend Flash remoting. http://www.amfphp.org/