require_once
require_once

Reputation: 2055

how to send data from sqlite to MYSQL

I had developed an Application in android in which I fetch some data from MYSQL database and do some operations on it and store it in SQLite.Now I want to send all the data stored in SQLite to MYSQL.I know i need to use JSON there.I will store my result in Cursor say Cursor c="select * from emp" (just example) now how i will parse this cursor into String to send it to the php page? and how i will decode it there?? Please help me.

Upvotes: 1

Views: 2223

Answers (1)

sivann
sivann

Reputation: 2131

If what you are asking is how you can encode data and send it to php as GET parameter you could use the following:

$encoded=base64_encode(serialize($data)) and then call example.com/?data=$encoded where $data could be the query result from $data=$sth->fetchAll(PDO::FETCH_ASSOC);

and on the receiving end: $decoded=unserialize(base64_decode($_GET['data']))

but this will limit you to about 2K of data.

If you can use POST, then use POST.

Upvotes: 1

Related Questions