I Know that we can always fetch from one database server and rewrite it to another. But what is the simplest way to do this?
We have to connect to the database server from php using the mysql_connect and store the connection identifier in a variable and then fetch the data from the server and then close the server connections using mysql_close() and then connect to another server and insert the value there.
Connected to the first server fetch the data and stored in the $res variable
$db=mysql_pconnect("host","username","pssword"); mysql_select_db("dtabase name",$db); $query="select * from the table"; $res=mysql_fetch_object(mysql_query($query)); mysql_close($db)
Connected to the second server
$db=mysql_pconnect("secondhost","username","pssword"); mysql_select_db("dtabase name",$db); $query="insert into tablename values($res)"; mysql_close($db);
I have created a form which take in values like NAME ADDRESS EMAIL ID PHOTO PHONE NUMBER
i want to add these values into database, but i am having a problem in inserting the Image (photo).
how we can retrieve the unique values for the in a table without using the DISTINCT keyword