Witam, posiadam skrypt:
<?php
if (isset($_POST['submit'])) { // if form has been submitted
/* 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']) {
die('You did not fill in a required field.');
}
//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) {
die('Sorry, the username: <strong>'.$_POST['uname'].'</strong>'
. ' is already taken, please pick another one.');
}
Wywala błąd:
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' = 'test'' at line 1
Już sam nie wiem, nie można usunąć, ponieważ jak dobrze rozumiem wtedy by można kilka razy rejestrować ten sam login. Proszę o pomoc.