> INSERT INTO chat VALUES not work, what i did wrong?

INSERT INTO chat VALUES not work, what i did wrong?

Posted at: 2014-12-18 
Change your code to this:

mysqli_select_db($connect, "a2955851_SW");

$query = mysqli_query($connect, "INSERT INTO chat VALUES ('$username');") or die(mysqli_error($connect));

$query = mysqli_query($connect, "INSERT INTO users VALUES('$username','$pass','$email');") or die(mysqli_error($connect));

//header("location:justregister.php");

This will output the the error message from MySQL. More than likely, there is an issue with your query (invalid data type, constraint fails, etc.).

I have problem with my register php.

And my problem is: $query = mysqli_query($connect, "INSERT INTO chat VALUES ('$username');");

not work.

And there is part my code :

{

mysqli_select_db($connect, "a2955851_SW");

$query = mysqli_query($connect, "INSERT INTO chat VALUES ('$username');");

$query = mysqli_query($connect, "INSERT INTO users VALUES('$username','$pass','$email');");

header("location:justregister.php");

}

$query = mysqli_query($connect, "INSERT INTO users VALUES('$username','$pass','$email');");

header("location:justregister.php");

this work

WTF?

other INSERT INTO users work but INSERT INTO chat not work.

help me, i'm noob. :D