Sending info to a mysql database.

  • 46 favourites


5,528 visits, 8,162 views



This tutorial hasn't been translated.


This tutorial is licensed under CC BY 4.0. Please refer to the license text if you wish to reuse, share or remix the content contained within this tutorial.

After going crosseyed looking for info for newbies I decided to do the ole trial and error to link up to a mysql database. So far what I can do is send info to the database. This tutorial assumes you can create the mysql database already.

1: Populate the mysql database with the following fields


-timestamp(timesent) set this to autoincrement


2: Here is the PHP file


$username = $_GET['fname'];

$score = $_GET['testy'];

$con = mysql_connect("localhost","userid","password");

if (!$con)


die('Could not connect: ' . mysql_error());


mysql_select_db("name of database", $con);

mysql_query("INSERT INTO nameoftable (playerid, text) VALUES ($username, $score)");



3: Now in your layout create a text box called "chatinput" as well as a button called "chatinputsend"

4: In the event sheet create an event

chatinputsend - onclick - AJAX - Request - "phpfiledirectorylisting?fname='lance'&testy='" & chatinput.Text & "'"

The above code sends the text box information into the appropriate fields within the mysql database. Hope that helps. Now to just figure out how to pull the information down from the database to populate a text window. Any ideas?


  • Order by
Want to leave a comment? Login or Register an account!