You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near ''users' WHERE 'username' = ''' at line 1
Nie wiem co już robić, plik rejestracji poniżej. Wg. przeglądarki linia 37 i 39 z błędem.
<?php /* check they filled in what they supposed to, passwords matched, username isn't already taken, etc. */ if (!$_POST['uname'] || !$_POST['passwd'] || !$_POST['passwd_again'] || !$_POST['email']) { } //validate the inputs $_POST['uname'] = safe($_POST['uname']); $_POST['passwd'] = safe($_POST['passwd']); $_POST['email'] = safe($_POST['email']); $_POST['tele'] = safe($_POST['tele']); $_POST['gg'] = safe($_POST['gg']); // check if username exists in database. $qry = "SELECT 'username' FROM 'users' WHERE 'username' = '".$_POST['uname']."'"; if ($name_checkk != 0) { . ' is already taken, please pick another one.'); } // check passwords match if ($_POST['passwd'] != $_POST['passwd_again']) { } // check e-mail format } // check show_email data if ($_POST['show_email'] != 0 & $_POST['show_email'] != 1) { } // now we can add them to the database. // encrypt password $_POST['passwd'] = sha1($salt.$_POST['passwd']); $insert = "INSERT INTO 'users' ( username, password, regdate, email, tele, gg, show_email) VALUES ( '".$_POST['uname']."', '".$_POST['passwd']."', '$regdate', '".$_POST['email']."', '".$_POST['tele']."', '".$_POST['gg']."', '".$_POST['show_email']."')"; ?> <h1>Registered</h1> <p>Thank you, your information has been added to the database, you may now <a href="index.php?id=login" title="Login">log in</a>.</p> <?php } else { // if form hasn't been submitted ?> <h1>Register</h1> <form action="index.php?id=register" method="post"> <table align="center" border="1" cellspacing="0" cellpadding="3"> <tr><td>Username*:</td><td> <input type="text" name="uname" maxlength="40"> </td></tr> <tr><td>Password*:</td><td> <input type="password" name="passwd" maxlength="50"> </td></tr> <tr><td>Confirm Password*:</td><td> <input type="password" name="passwd_again" maxlength="50"> </td></tr> <tr><td>E-Mail*:</td><td> <input type="text" name="email" maxlength="100"> </td></tr> <tr><td>Telefon:</td><td> <input type="text" name="tele" maxlength="150"> </td></tr> <tr><td>GaduGadu</td><td> <input type="text" name="gg" maxlength="150"> </td></tr> <tr><td>Newsletter?</td><td> <select name="show_email"> <option value="1" selected="selected">Yes</option> <option value="0">No</option></select> </td></tr> <tr><td colspan="2" align="right"> <input type="submit" name="submit" value="Sign Up"> </td></tr> </table> </form> <?php } ?>