nie dodaje wartości do bazy

0

Nie dodaje mi do bazy wartości ?
Php

$database = mysqli_connect('host', 'log', 'pass') or die('Could not connect: ' . mysql_error());
mysqli_select_db($database,'matib12') or die('Could not select database');
$newuser= $_POST['nazwa'];
$newscore= $_POST['punkty'];






    $nw="insert into 'ranking'('nazwa','PUNKTY') VALUES ($newuser,$newscore)";
    mysqli_query($database,$nw);





?>

i C# w unity

using UnityEngine;
using System.Collections;
using UnityEngine.UI;

public class punkty : MonoBehaviour {
    public float punk;public int punkt;
    public Text text, text1;
    public string user,has= "7wskaSs3Nb";
	// Use this for initialization
	void Start () {
        user = PlayerPrefs.GetString("nick");
	  
        int best1;
        punk = PlayerPrefs.GetFloat("punkty");
        punkt = (int)punk;
        best1 = PlayerPrefs.GetInt("best1");
        text.text = "Score: " + punkt.ToString();
        if (punkt > best1)
        {
            StartCoroutine(Add());
            PlayerPrefs.SetInt("best1", punkt);
           
        }
        else
        {

        }
    }
	
	// Update is called once per frame
	void Update () {
	
	}

    IEnumerator Add()
    {
        Debug.Log("działa");
        WWWForm ad = new WWWForm();
        ad.AddField("nazwa", user);
        ad.AddField("punkty", punkt);
        WWW dataadd = new WWW("http://host/add.php", ad);
      
        yield return dataadd;
    }
}

Co tu nie działa?

0

nie znam ani php ani mysql wiec moge sie mylic ale tak na logike w query to zamiast

$nw="insert into 'ranking'('nazwa','PUNKTY') VALUES ($newuser,$newscore)";

powinienes miec

$nw="insert into ranking(nazwa,PUNKTY) VALUES ('$newuser',$newscore)";

ale pewnie jeszcze inne rzeczy masz skopane

1 użytkowników online, w tym zalogowanych: 0, gości: 1