#Help mysql - database - unity
1 messages · Page 1 of 1 (latest)
Your request reaches the server. Server has the error information
think is error 500?
hmm i see.
Error 500 just mean unknown error happened from your server
You need to test your server
Hmm other is "dbconnection" is working?
check look
and there "createuser.php"
Okay i see but check investigate maybe hard.
no have logs but idk okay well...
moment ok use postman
Look

empty lol
@vocal tendon is server cloudflare
What is empty? Postman is client
yeah
From the POSTman….
yeah but is empty.
You can set the body values from POSTman
Yeah let’s try
Yes it says 500
So it is not Unity problem
yeah i know.
Your server has the error detail
yes, how solution?
You have access to your server?
Not much but I know server stuffs
i see but need help.
You can get error logs right?
no have logs error where.
and yes error have 500
how solution no idea
but there is:
yeah but my little experience and i am no professional.
and there exactly web server
login and password mysql for unity
tutorial is old date.
problem nothing 2020
and no idea solution.
Which tutorial did you use?
only spanish tutorial there and no problem here look: https://drive.google.com/drive/folders/1yamfRL8wicoBBssDFW6eoM_QFmHoPiJV
How did you install your php?
ya have php version current
actual.
why use have is "hostinger"
think
there is "Options -Indexes"
?
ah okay you are hosting on them
Could be or could not be
here is for hostinger
yes work
Then you can check the error_log
i see line 5 to 8 error
can you paste the error?
[17-Aug-2022 06:41:03 UTC] PHP Notice: Undefined index: Nickname in /home/u746990723/domains/benzitczostudio.com/public_html/noallowspytic/noallowspyfuck/CreatedUser.php on line 6
[17-Aug-2022 06:41:03 UTC] PHP Notice: Undefined index: Password in /home/u746990723/domains/benzitczostudio.com/public_html/noallowspytic/noallowspyfuck/CreatedUser.php on line 7
[17-Aug-2022 06:41:03 UTC] PHP Notice: Undefined index: Email in /home/u746990723/domains/benzitczostudio.com/public_html/noallowspytic/noallowspyfuck/CreatedUser.php on line 8
[17-Aug-2022 06:41:03 UTC] PHP Fatal error: Uncaught PDOException: SQLSTATE[42S22]: Column not found: 1054 Unknown column 'Username' in 'where clause' in /home/u746990723/domains/benzitczostudio.com/public_html/noallowspytic/noallowspyfuck/CreatedUser.php:12
Stack trace:
#0 /home/u746990723/domains/benzitczostudio.com/public_html/noallowspytic/noallowspyfuck/CreatedUser.php(12): PDO->query('SELECT User Fro...')
#1 {main}
thrown in /home/u746990723/domains/benzitczostudio.com/public_html/noallowspytic/noallowspyfuck/CreatedUser.php on line 12```
yes
and modify differents
The log says CreatedUser
and parameters are different
Oh so the code is different okay
yeah
include "DBConnection.php";
$User = $_POST['User'];
$Nickname = $_POST['Nickname'];
$Password = hash("sha256", $_POST['Password']); //metodo hash el sha256 hash para encriptacion
$Email = $_POST['Email'];
//n la query cuando llame la tabla poner tambien la base de datos osea select userName from (game)doctores.usuarios ...
$sql = "SELECT User From Usuarios WHERE Username = '$User'";//leer de nuestra tabla usuarios donde Username(en formulario) se aigual a userName en bd
$result = $pdo->query($sql);
if($result->rowCount()>0)//comprobamos que si ya hay mas de 1 osea >0 entonces seria falso
{
$data = array('done' => false, 'message' => "Error, nombre de usuario ya existe");
Header('Content-Type: application/json');
echo json_encode($data);//utilizamos echo de json para enviar los datos
exit();//romper la ejecusion si es correcto
}
else{
//comprobamos que el email no exista
$sql = "SELECT Email From Usuarios WHERE Email = '$Email'";
$result = $pdo->query($sql);
if($result->rowCount()>0)//comprobamos que si ya hay mas de 1 osea >0 entonces falso.
{
$data = array('done' => false, 'message' => "Error, Email ya existe");
Header('Content-Type: application/json');
echo json_encode($data);
exit();
}
else{
//leemos que lo insertado esta aprobado true osea no repetido en la tabla usuarios de bd
$sql = "INSERT INTO Usuarios SET User = '$User, Nickname = '$Nickname, Password = '$Password, Email = '$Email'";
$pdo->query($sql);
//en caso que sea true enviaremos el mensaje
$data = array('done' => true, 'message' => "Usuario nuevo creado");
Header('Content-Type: application/json');
echo json_encode($data);
exit();
}
}
?>
there
or no idea you? okay no problem other server help discord.
So the error says there is no "User" "Nickname" "Password" "Email" in your POST body
yeah but wait think complicated.
What is your URL? I can try post from my side..
ok
Oh.. also your DB setup needs to be fixed
ya have is okay DB
Column not found: 1054 Unknown column 'Username' in 'where clause' in /home/u746990723/domains/benzitczostudio.com/public_html/noallowspytic/noallowspyfuck/CreatedUser.php:12
Hmm werid.
Ah
I see
wait fixed.
think is user
not username
solution fix 12 line
again error 5 to 8 same
I can post if you send me url
and 38 error lol
@vocal tendon yes
okay still undefined index
Yeah.. I think I'm sending correctly but still gets undefined index
i see but how solution?
Still same error? I posted just now
I think Error line 38 is just happening because everything is empty
thrown in /home/u746990723/domains/benzitczostudio.com/public_html/noallowspytic/noallowspyfuck/CreatedUser.php on line 38
[17-Aug-2022 06:53:15 UTC] PHP Fatal error: Uncaught PDOException: SQLSTATE[42000]: Syntax error or access violation: 1064 You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near 'hello, Password = '2597a7caf656e89e9ab35e12326d557ebfe9b7b5dcbe4c564e74070fa5...' at line 1 in /home/u746990723/domains/benzitczostudio.com/public_html/noallowspytic/noallowspyfuck/CreatedUser.php:38
Stack trace:
#0 /home/u746990723/domains/benzitczostudio.com/public_html/noallowspytic/noallowspyfuck/CreatedUser.php(38): PDO->query('INSERT INTO Usu...')
#1 {main}
thrown in /home/u746990723/domains/benzitczostudio.com/public_html/noallowspytic/noallowspyfuck/CreatedUser.php on line 38
[17-Aug-2022 07:03:22 UTC] PHP Fatal error: Uncaught PDOException: SQLSTATE[42000]: Syntax error or access violation: 1064 You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near ' Nickname, Password, Email = 'myusername, Nickname = 'hello, Password = '2597...' at line 1 in /home/u746990723/domains/benzitczostudio.com/public_html/noallowspytic/noallowspyfuck/CreatedUser.php:38
Stack trace:
#0 /home/u746990723/domains/benzitczostudio.com/public_html/noallowspytic/noallowspyfuck/CreatedUser.php(38): PDO->query('INSERT INTO Usu...')
#1 {main}
thrown in /home/u746990723/domains/benzitczostudio.com/public_html/noallowspytic/noallowspyfuck/CreatedUser.php on line 38```
Oh other errors are gone?
Alright then almost there
and your SQL needs to get fixed
$sql = "INSERT INTO Usuarios SET User = '$User, Nickname = '$Nickname, Password = '$Password, Email = '$Email'";
@vocal tendon
Do you see ' is missing after $User $Nickname $Password ?
Yes
Okay wait second
$sql = "INSERT INTO Usuarios SET User = '$User', Nickname = '$Nickname', Password = '$Password', Email = '$Email'";
Should be fixed like this
OK wait
Let me know when you're done so I'll POST again
200!
{
"done": true,
"message": "Usuario nuevo creado"
}
i see
So your Unity should work now.
there is okay and maybe is last 38 error
Yes moment
line 38 error is fixed with your code
yeah
Done unity
and waiting "loading"
no working maybe problem code webunityXD
And empty console 👀
Now you can check error message
Does that mean no 500?
no
is okay work
and empty console
and loading waiting
maybe no working
So it's not the web request the issue
there code: #archived-code-general message @vocal tendon
exactly
responseText will not start with "Success" that's the thing
so empty console
responseText is like #1009337797515169842 message
hmm yeah how :/
Hmm
There'd be reason that hangs on the loading 🙂
yeah maybe
@vocal tendon Okay no problem
thanks help and tomorrow again ok
my sleep rest.
Good night
@vocal tendon ah i see
there ..
already ID and pass
said processing...
no working problem.
example login -> profile
Okay
no problem ignore and solution idea
thanks gn
Sup
problem werid enter link page and account register wtf but is problem no allow enter page register (only game not page)
example
but do not use or idk maybe problem.
and only is game
and said unity console : HTTP/1.1 404 Not Found
404 not found means your address is wrong
yeah exactly.
problem no working hmm
which of your url gives 404 not found?
yes there.

Ah
i see hmm
moment fixed.
Fixed? nice
Que bueno
So remove your if
Yes responseText will not starts with "Success"
Should be
Yess i know
my remember minutes.
but my forgetl ol
is hard developer hehe.
Done solution
I know it's not easy
I think you need to do
using (var request = UnityWebRequest.Post(...))
See examples
Well is the request success?
yes sucess
and probably problem werid missing email
why said "Olivia12"
where is @gmail.com lol
No problem ask help php
how there think $Email = $_POST['Email'];
hmm
Done
how is?
UnityWebRequest.EscapeURL(email, wwform maybe?)
xd
sorry my bad.
No replace it like Form.AddField("Email", UnityWebRequest.EscapeURL(email))
that is gonna make "abcd@gmail.com" to "abcd%40gmail.com"
Yes
Did you change the register part too?
maybe
change already all
and missing email problem
xd
Hmm it should work
maybe php
Mayybe
Yeah I think it should work
hmm
Maybe your code is not saved? XD
yeah maybe
No problem thanks help @vocal tendon
and waiting other help php
Done solution all good.
ok later wait
They fixed it?
@vocal tendon Yes okay later
and but
problem why email no is password
confuse.
wait check.
Olivias12 why is password for email? wtf
confuse lol
@vocal tendon look
maybe is okay
probably php fix moment.
i see
Oh you put it in the wrong order?
yes
Yeah that will fix
Okay, but your parameter order was wrong
how is?
you putting username, nickname, email, password
sigh is hard see lol
see the parameter of CreateUser
NM.CreateUser(m_userNameInput.text, m_nickname.text, m_emailInput.text, m_password.text, delegate (Response response)
there?
how is order wrong.
maybe is NM.CreateUser(m_userNameInput.text, m_nickname.text, m_password.text, m_emailInput.text, delegate (Response response)
to correct?
yeah
public void CreateUser(string User, string Nickname, string Email, string Password, Action<Response> response)
is correct?
good?
hmm
Yes
@vocal tendon
work lol.
i see
remove espaceurl
is work @ maybe
Done solution @vocal tendon
thanks good
finishh
learn... much little hard
yes
@vocal tendon okay good register
and problem login no working 500 error
D:
$result = $pdo ->query($sql);```
#1 {main}
thrown in /home/u746990723/domains/benzitczostudio.com/public_html/noallowspytic/noallowspyfuck/checkUser.php on line 9
@vocal tendon hmm
how is?
where ilol.
Inside of your DB query man
yeah but have is "table: users"
and there user
No your parameter needs to be quoted
Because they are string
yes same string "User"
wwait what there is $User = $_POST['$User'];
?
sorry bad understand
xd
there is create account
$sql = "SELECT User From users WHERE User = '$User'"
and login account
$sql = "SELECT User From users WHERE User =$User AND password =$Password ";
hmm i see
$sql = "SELECT User From users WHERE User = '$User AND password =$Password ' ";
probably?
You forgot closing ‘
And password too
Ah missing
$sql = "SELECT User From users WHERE User = '$User AND password = '$Password ' ";
exactly?
error 500 lol
what hmm
Good work
Have fun with coding
yeah true lol
but login web no working werid and there lol
oh maybe missing "name="password"" // also forget "select" lol
Making website now?
wait problem no working.
$sql = "SELECT id, user, password FROM users WHERE user = ?,?,?";
there think
incorrect?
// Initialize the session
session_start();
// Check if the user is already logged in, if yes then redirect him to welcome page
if(isset($_SESSION["loggedin"]) && $_SESSION["loggedin"] === true){
header("location: profile.php");
exit;
}
// Include config file
require_once "config.php";
// Define variables and initialize with empty values
$username = $password = "";
$username_err = $password_err = $login_err = "";
// Processing form data when form is submitted
if($_SERVER["REQUEST_METHOD"] == "POST"){
// Check if username is empty
if(empty(trim($_POST["user"]))){
$username_err = "Please enter username.";
} else{
$username = trim($_POST["user"]);
}
// Check if password is empty
if(empty(trim($_POST["password"]))){
$password_err = "Please enter your password.";
} else{
$password = trim($_POST["password"]);
}
// Validate credentials
if(empty($username_err) && empty($password_err)){
// Prepare a select statement
$sql = "SELECT id, user, password FROM users WHERE user = ?,?,?";
if($stmt = mysqli_prepare($link, $sql)){
// Bind variables to the prepared statement as parameters
mysqli_stmt_bind_param($stmt, "s", $param_username,);
// Set parameters
$param_username = $username;
//$param_server = $server;
// Attempt to execute the prepared statement
if(mysqli_stmt_execute($stmt)){
// Store result
mysqli_stmt_store_result($stmt);
// Check if username exists, if yes then verify password
if(mysqli_stmt_num_rows($stmt) == 1){
// Bind result variables
mysqli_stmt_bind_result($stmt, $id, $username, $hashed_password);
if(mysqli_stmt_fetch($stmt)){
if(password_verify($password, $hashed_password)){
// Password is correct, so start a new session
session_start();
// Store data in session variables
$_SESSION["loggedin"] = true;
$_SESSION["id"] = $id;
$_SESSION["user"] = $username;
$_SESSION["password"] = $password;
// Redirect user to welcome page
header("location: profile.php");
} else{
// Password is not valid, display a generic error message
$login_err = "Invalid username or password.";
}
}
} else{
// Username doesn't exist, display a generic error message
$login_err = "Invalid username or password.";
}
} else{
echo " 3 Oops! Something went wrong. Please try again later.";
}
// Close statement
mysqli_stmt_close($stmt);
}
}
// Close connection
mysqli_close($link);
}
?>```

error logs:
[18-Aug-2022 06:11:38 UTC] PHP Notice: Undefined index: password in /home/u746990723/domains/benzitczostudio.com/public_html/new/login/index.php on line 29
no password in $_POST?
did you put name=password thing
And you better hard reload your browser too
yes there name="password"
Empty cache too?
nah okay other broswer
moment
already no working lol.
ah found @vocal tendon error
[18-Aug-2022 06:27:02 UTC] PHP Warning: mysqli_stmt_bind_param(): Number of variables doesn't match number of parameters in prepared statement in /home/u746990723/domains/benzitczostudio.com/public_html/new/login/index.php on line 42
[18-Aug-2022 06:27:15 UTC] PHP Warning: mysqli_stmt_bind_param(): Number of variables doesn't match number of parameters in prepared statement in /home/u746990723/domains/benzitczostudio.com/public_html/new/login/index.php on line 42```
well it’s different error
maybe
You have 3 parameters as I see
maybe is user , pass and id?
I also think that SELECT sql is wrong, you can ask php people
yeah help is sleep name "hunter" discord
xd
nothing help who lol
waiting reply mod
maybe but is okay working
werid
there found is same code.
But probably problem "hash" password
success work
if (strtoupper(hash("SHA256", $password)) == strtoupper($hashed_password)) { <- solution
@vocal tendon other
found better auto login good done
and problem register no work "nickname"
lol.
there look is okay?
Is your table/column/parameter names all correct
Yeah okay memory
already.
and last problem register no work maybe script unity
when "nickname no coinicde" problem why already nickname button
no sent sumbit register.
@vocal tendon
maybe think problem "user" missing text?
Well you need username and password with that php
No need but
my idea there is Steam
ID steam + nickname
not password.
Or yes password (random)
think my idea.
i know have id and pass
is working 
and now remove pass and user + nickname test
@vocal tendon question how auto text TMP_InputField?
think same usertext.text = "nick"?
Yes