Sending values from Unity to PhP to SQL.

Hey, ive currently been fixing around with databases used for highscores. So far im actually able to get information from SQL > PhP > Unity in real time, but i cant seem to send values from unity to the sql database.

I have 2 PhP scripts and one Unityscript

Addingscores (addscores.php)


 $db = mysql_connect('*******', '******_***', '********') or die('Could not connect: ' . mysql_error()); 
        mysql_select_db("******_***", $db) or die('Could not select database');

        // Strings must be escaped to prevent SQL injection attack. 
        $name = mysql_real_escape_string($_GET['name'], $db); 
        $score = mysql_real_escape_string($_GET['score'], $db); 
        $hash = $_GET['hash']; 

        $secretKey="******"; # Change this value to match the value stored in the client javascript below 

         $real_hash = md5($name . $score . $secretKey); 
        if($real_hash == $hash) { 
            // Send variables for the MySQL database class. 
            $query = "INSERT INTO scores(CORRECT_COL_NAMES) VALUES ('null', 'name','$score')";
            $results = mysql_query($query, $connection);

There is no errors popping up whatsoever on the website so it has been connected properly.

Displayscores on website(display.php)

<head> Getting Scores </head>


<head3><strong>Name,     Score</strong></head3>

    // Send variables for the MySQL database class.
    $database = mysql_connect('*******', '*******_******', '*******') or die('Could not connect: ' . mysql_error());
    mysql_select_db('*******_***') or die('Could not select database');
    $query = "SELECT * FROM `scores` ORDER by `score` DESC LIMIT 5";
    $result = mysql_query($query) or die('Query failed: ' . mysql_error());
    $num_results = mysql_num_rows($result);  
    for($i = 0; $i < $num_results; $i++)
         echo "  

$row = mysql_fetch_array($result);
echo $row[‘name’] . " " . $row[‘score’] . "
This is the script i use in Unity as my controller

private var secretKey="*******"; // Edit this value and make sure it's the same as the one stored on the server
var addScoreUrl="*********************"; //be sure to add a ? to your url
var highscoreUrl="*********************";    
var pname : String = "";
var score : long = 0;

var native_width : float = 1920;
var native_height : float = 1080;

function Start() {
function postScore(pname, score) {
    //This connects to a server side php script that will add the name and score to a MySQL DB.
    // Supply it with a string representing the players name and the players score.
    var hash=Md5.Md5Sum(pname + score + secretKey); 
    var highscore_url = addScoreUrl + "name=" + WWW.EscapeURL(pname) + "&score=" + score + "&hash=" + hash;
    // Post the URL to the site and create a download object to get the result.
    hs_post = WWW(highscore_url);
    yield hs_post; // Wait until the download is done
    if(hs_post.error) {
        print("There was an error posting the high score: " + hs_post.error);
// Get the scores from the MySQL DB to display in a GUIText.
function getScores() {
    cookiecounter.status = "Loading Scores";
    hs_get = WWW(highscoreUrl);
    yield hs_get;
    if(hs_get.error) {
    	print("There was an error getting the high score: " + hs_get.error);
    } else {
        cookiecounter.status = hs_get.text; // this is a GUIText that will display the scores in game.

function OnGUI () {

	var rx : float = Screen.width / native_width;
    var ry : float = Screen.height / native_height;
    GUI.matrix = Matrix4x4.TRS (Vector3(0, 0, 0), Quaternion.identity, Vector3 (rx, ry, 1)); 

if (GUI.Button(new Rect(900,1000,100,70), "Post Record"))
	pname = cookiecounter.Username;
	score = cookiecounter.tcounter;
	postScore(pname, score);
if (GUI.Button(new Rect(1000,1000,100,70), "Get Record"))

My SQL Query

How it looks ingame(ignore number at top, also if you know how to remove the coding then please help)

Display on website

As you can see im actually getting the scores from the SQL to the PhP script and then to Unity realtime, but i cannot seem to do it the other way around. Blanked out passwords etc.

If you need more info please tell me.
Thanks in advance ^^

i think you can create xml file with unity engine and read it with php than write to database