What happened to the Messenger Plus! forums on msghelp.net?
Shoutbox » MsgHelp Archive » Messenger Plus! for Live Messenger » Scripting » Connecting to a online SQL dabatase

Connecting to a online SQL dabatase
Author: Message:
absorbation
Elite Member
*****

Avatar

Posts: 3636
Reputation: 81
– / Male / Flag
Joined: Feb 2005
RE: Connecting to a online SQL dabatase
Personally I would use PHP to connect to an online MySQL database. You can send information to a PHP script from your computer using the server variables $_POST and $_GET. If you understand what I am on about the amount of code required is rather small, and the task itself is easier than it sounds (if you understand what I meant).

If you don't get what I'm on about, I'm sure I can find you some live examples.


Edit: I've made an example for you :).


OK then this is easier than it may appear. First set up your database, customise it, there are no limitations, do as you wish. Next we need to get your script talking to your PHP script:

code:
var http = new ActiveXObject("Microsoft.XMLHTTP");
http.open ("POST", "http://www........", true);
http.send ("?sex=male&name=absorbation&address=fakestreet&dob=00.01.01");

Note: Change the url to wherever your script is located. Also &variable='variable data' is what your $_POST variable will be called and the data it will contain.


Finally we need to set up the PHP to communicate with the database:

code:
<?PHP
// Make sure you are connected to the database, and validate the data to make sure people don't abuse your script.
// Getting data sent to the server from the script. The varibles below will be used in the MySQL query.

$sex = $_POST['sex'];
$name = $_POST['name'];
$address = $_POST['address'];
$dob = $_POST['dob'];

// Display the data to make sure it is working.

echo "$sex<br />$name<br />$address<br />$dob";

// MySQL query, make sure you change the query to match your database.

mysql_query("insert into client_details '$sex', '$name', '$address', '$dob'");
?>

This post was edited on 04-03-2007 at 07:21 PM by absorbation.
04-03-2007 07:00 PM
Profile PM Find Quote Report
« Next Oldest Return to Top Next Newest »

Messages In This Thread
Connecting to a online SQL dabatase - by LifelesS on 04-03-2007 at 06:19 PM
RE: Connecting to a online SQL dabatase - by absorbation on 04-03-2007 at 07:00 PM
RE: Connecting to a online SQL dabatase - by LifelesS on 04-03-2007 at 08:40 PM
RE: Connecting to a online SQL dabatase - by ShawnZ on 04-03-2007 at 09:36 PM
RE: Connecting to a online SQL dabatase - by -dt- on 04-04-2007 at 02:36 AM


Threaded Mode | Linear Mode
View a Printable Version
Send this Thread to a Friend
Subscribe | Add to Favorites
Rate This Thread:

Forum Jump:

Forum Rules:
You cannot post new threads
You cannot post replies
You cannot post attachments
You can edit your posts
HTML is Off
myCode is On
Smilies are On
[img] Code is On