Skip to main content
AI Assist is now on Stack Overflow. Start a chat to get instant answers from across the network. Sign up to save and share your chats.
stackoverflow strives to be like an encyclopedia, there is not need for pleasantries
Source Link
Artjom B.
  • 62k
  • 26
  • 137
  • 236

Hello there,

I'm inserting into MySQL using PHP, the Code goes through but when I query the database I find nothing in my Database. I can't figure out whats happening. I have five fields in my Db(ID,username,email,password,salt). Below is my PHP code.

<?php include 'db_connect.php'; include 'functions.php'; $password = $_POST['password']; $random_salt = hash('sha512', uniqid(mt_rand(1, mt_getrandmax()), true)); $password = hash('sha512', $password.$random_salt); if ($insert_stmt = $mysqli->prepare("INSERT INTO members (username, email, password,salt) VALUES (?, ?, ?, ?)")) { $insert_stmt->bind_param('ssss', $username, $email, $password, $random_salt); $insert_stmt->execute(); echo 'User added'; } else { echo 'Error couldnt add the user, Try again'; } ?> 

And Below is my Form used for the registration.

 <form id="form1" name="form1" method="post" action="Registration Process.php"> <table width="373" height="130" border="1"> <tr> <td width="180" height="27">Username (Name &amp; Surname)</td> <td width="140"><label for="username"></label> <input type="text" name="username" id="username" /></td> </tr> <tr> <td height="23">Email</td> <td><label for="email"></label> <input type="text" name="email" id="email" /></td> </tr> <tr> <td height="22">Password</td> <td><label for="password"></label> <input type="text" name="password" id="password" /><label for="salt"> </label> </td> </tr> <tr> <td height="22">Salt</td> <td><input type="text" name="salt" id="salt" /></td> </tr> <tr> <td height="22">Click To register member</td> <td><input type="submit" name="register" id="register" value="Submit" /></td> </tr> </table> <p>&nbsp;</p> <!-- end .content --> </form>  

Please help, I'm stuck here. Thanks in advanced.

Hello there,

I'm inserting into MySQL using PHP, the Code goes through but when I query the database I find nothing in my Database. I can't figure out whats happening. I have five fields in my Db(ID,username,email,password,salt). Below is my PHP code.

<?php include 'db_connect.php'; include 'functions.php'; $password = $_POST['password']; $random_salt = hash('sha512', uniqid(mt_rand(1, mt_getrandmax()), true)); $password = hash('sha512', $password.$random_salt); if ($insert_stmt = $mysqli->prepare("INSERT INTO members (username, email, password,salt) VALUES (?, ?, ?, ?)")) { $insert_stmt->bind_param('ssss', $username, $email, $password, $random_salt); $insert_stmt->execute(); echo 'User added'; } else { echo 'Error couldnt add the user, Try again'; } ?> 

And Below is my Form used for the registration.

 <form id="form1" name="form1" method="post" action="Registration Process.php"> <table width="373" height="130" border="1"> <tr> <td width="180" height="27">Username (Name &amp; Surname)</td> <td width="140"><label for="username"></label> <input type="text" name="username" id="username" /></td> </tr> <tr> <td height="23">Email</td> <td><label for="email"></label> <input type="text" name="email" id="email" /></td> </tr> <tr> <td height="22">Password</td> <td><label for="password"></label> <input type="text" name="password" id="password" /><label for="salt"> </label> </td> </tr> <tr> <td height="22">Salt</td> <td><input type="text" name="salt" id="salt" /></td> </tr> <tr> <td height="22">Click To register member</td> <td><input type="submit" name="register" id="register" value="Submit" /></td> </tr> </table> <p>&nbsp;</p> <!-- end .content --> </form>  

Please help, I'm stuck here. Thanks in advanced.

I'm inserting into MySQL using PHP, the Code goes through but when I query the database I find nothing in my Database. I can't figure out whats happening. I have five fields in my Db(ID,username,email,password,salt). Below is my PHP code.

<?php include 'db_connect.php'; include 'functions.php'; $password = $_POST['password']; $random_salt = hash('sha512', uniqid(mt_rand(1, mt_getrandmax()), true)); $password = hash('sha512', $password.$random_salt); if ($insert_stmt = $mysqli->prepare("INSERT INTO members (username, email, password,salt) VALUES (?, ?, ?, ?)")) { $insert_stmt->bind_param('ssss', $username, $email, $password, $random_salt); $insert_stmt->execute(); echo 'User added'; } else { echo 'Error couldnt add the user, Try again'; } ?> 

And Below is my Form used for the registration.

 <form id="form1" name="form1" method="post" action="Registration Process.php"> <table width="373" height="130" border="1"> <tr> <td width="180" height="27">Username (Name &amp; Surname)</td> <td width="140"><label for="username"></label> <input type="text" name="username" id="username" /></td> </tr> <tr> <td height="23">Email</td> <td><label for="email"></label> <input type="text" name="email" id="email" /></td> </tr> <tr> <td height="22">Password</td> <td><label for="password"></label> <input type="text" name="password" id="password" /><label for="salt"> </label> </td> </tr> <tr> <td height="22">Salt</td> <td><input type="text" name="salt" id="salt" /></td> </tr> <tr> <td height="22">Click To register member</td> <td><input type="submit" name="register" id="register" value="Submit" /></td> </tr> </table> <p>&nbsp;</p> <!-- end .content --> </form> 

No errors but I cantcan't see my data in database

HaloHello there,

I'm inserting into MySqlMySQL using PHP, the Code goes through but when I query the database iI find nothing in my Database. I cantcan't figure out whats happening. I have five fields in my Db(ID,username,email,password,salt). Below is my phpPHP code.

<?php include 'db_connect.php'; include 'functions.php'; $password = $_POST['password']; $random_salt = hash('sha512', uniqid(mt_rand(1, mt_getrandmax()), true)); $password = hash('sha512', $password.$random_salt); if ($insert_stmt = $mysqli->prepare("INSERT INTO members (username, email, password,salt) VALUES (?, ?, ?, ?)")) { $insert_stmt->bind_param('ssss', $username, $email, $password, $random_salt); $insert_stmt->execute(); echo 'User added'; } else { echo 'Error couldnt add the user, Try again'; } ?> 

And Below is my Form used for the registration.

 <form id="form1" name="form1" method="post" action="Registration Process.php"> <table width="373" height="130" border="1"> <tr> <td width="180" height="27">Username (Name &amp; Surname)</td> <td width="140"><label for="username"></label> <input type="text" name="username" id="username" /></td> </tr> <tr> <td height="23">Email</td> <td><label for="email"></label> <input type="text" name="email" id="email" /></td> </tr> <tr> <td height="22">Password</td> <td><label for="password"></label> <input type="text" name="password" id="password" /><label for="salt"> </label> </td> </tr> <tr> <td height="22">Salt</td> <td><input type="text" name="salt" id="salt" /></td> </tr> <tr> <td height="22">Click To register member</td> <td><input type="submit" name="register" id="register" value="Submit" /></td> </tr> </table> <p>&nbsp;</p> <!-- end .content --> </form> 

Please help, I'm stuck here. ThanxThanks in advanced.

No errors but I cant see my data in database

Halo there,

I'm inserting into MySql using PHP, the Code goes through but when I query the database i find nothing in my Database. I cant figure out whats happening. I have five fields in my Db(ID,username,email,password,salt). Below is my php code.

<?php include 'db_connect.php'; include 'functions.php'; $password = $_POST['password']; $random_salt = hash('sha512', uniqid(mt_rand(1, mt_getrandmax()), true)); $password = hash('sha512', $password.$random_salt); if ($insert_stmt = $mysqli->prepare("INSERT INTO members (username, email, password,salt) VALUES (?, ?, ?, ?)")) { $insert_stmt->bind_param('ssss', $username, $email, $password, $random_salt); $insert_stmt->execute(); echo 'User added'; } else { echo 'Error couldnt add the user, Try again'; } ?> 

And Below is my Form used for the registration.

 <form id="form1" name="form1" method="post" action="Registration Process.php"> <table width="373" height="130" border="1"> <tr> <td width="180" height="27">Username (Name &amp; Surname)</td> <td width="140"><label for="username"></label> <input type="text" name="username" id="username" /></td> </tr> <tr> <td height="23">Email</td> <td><label for="email"></label> <input type="text" name="email" id="email" /></td> </tr> <tr> <td height="22">Password</td> <td><label for="password"></label> <input type="text" name="password" id="password" /><label for="salt"> </label> </td> </tr> <tr> <td height="22">Salt</td> <td><input type="text" name="salt" id="salt" /></td> </tr> <tr> <td height="22">Click To register member</td> <td><input type="submit" name="register" id="register" value="Submit" /></td> </tr> </table> <p>&nbsp;</p> <!-- end .content --> </form> 

Please help, I'm stuck here. Thanx in advanced.

No errors but I can't see my data in database

Hello there,

I'm inserting into MySQL using PHP, the Code goes through but when I query the database I find nothing in my Database. I can't figure out whats happening. I have five fields in my Db(ID,username,email,password,salt). Below is my PHP code.

<?php include 'db_connect.php'; include 'functions.php'; $password = $_POST['password']; $random_salt = hash('sha512', uniqid(mt_rand(1, mt_getrandmax()), true)); $password = hash('sha512', $password.$random_salt); if ($insert_stmt = $mysqli->prepare("INSERT INTO members (username, email, password,salt) VALUES (?, ?, ?, ?)")) { $insert_stmt->bind_param('ssss', $username, $email, $password, $random_salt); $insert_stmt->execute(); echo 'User added'; } else { echo 'Error couldnt add the user, Try again'; } ?> 

And Below is my Form used for the registration.

 <form id="form1" name="form1" method="post" action="Registration Process.php"> <table width="373" height="130" border="1"> <tr> <td width="180" height="27">Username (Name &amp; Surname)</td> <td width="140"><label for="username"></label> <input type="text" name="username" id="username" /></td> </tr> <tr> <td height="23">Email</td> <td><label for="email"></label> <input type="text" name="email" id="email" /></td> </tr> <tr> <td height="22">Password</td> <td><label for="password"></label> <input type="text" name="password" id="password" /><label for="salt"> </label> </td> </tr> <tr> <td height="22">Salt</td> <td><input type="text" name="salt" id="salt" /></td> </tr> <tr> <td height="22">Click To register member</td> <td><input type="submit" name="register" id="register" value="Submit" /></td> </tr> </table> <p>&nbsp;</p> <!-- end .content --> </form> 

Please help, I'm stuck here. Thanks in advanced.

Source Link
Lord-David
  • 545
  • 2
  • 12
  • 34

No errors but I cant see my data in database

Halo there,

I'm inserting into MySql using PHP, the Code goes through but when I query the database i find nothing in my Database. I cant figure out whats happening. I have five fields in my Db(ID,username,email,password,salt). Below is my php code.

<?php include 'db_connect.php'; include 'functions.php'; $password = $_POST['password']; $random_salt = hash('sha512', uniqid(mt_rand(1, mt_getrandmax()), true)); $password = hash('sha512', $password.$random_salt); if ($insert_stmt = $mysqli->prepare("INSERT INTO members (username, email, password,salt) VALUES (?, ?, ?, ?)")) { $insert_stmt->bind_param('ssss', $username, $email, $password, $random_salt); $insert_stmt->execute(); echo 'User added'; } else { echo 'Error couldnt add the user, Try again'; } ?> 

And Below is my Form used for the registration.

 <form id="form1" name="form1" method="post" action="Registration Process.php"> <table width="373" height="130" border="1"> <tr> <td width="180" height="27">Username (Name &amp; Surname)</td> <td width="140"><label for="username"></label> <input type="text" name="username" id="username" /></td> </tr> <tr> <td height="23">Email</td> <td><label for="email"></label> <input type="text" name="email" id="email" /></td> </tr> <tr> <td height="22">Password</td> <td><label for="password"></label> <input type="text" name="password" id="password" /><label for="salt"> </label> </td> </tr> <tr> <td height="22">Salt</td> <td><input type="text" name="salt" id="salt" /></td> </tr> <tr> <td height="22">Click To register member</td> <td><input type="submit" name="register" id="register" value="Submit" /></td> </tr> </table> <p>&nbsp;</p> <!-- end .content --> </form> 

Please help, I'm stuck here. Thanx in advanced.