[php] Registartion help [php]
ok heres the code [PHP]<?php
$mysql_user = "root";
$mysql_pass = ";
$mysql_host = ";
$mysql_dbn = "simple webs";
mysql_connect($mysql_host, $mysql_user, $mysql_pass);
mysql_select_db($mysql_dbn);
$_POST['username'] = trim($_POST['username']);
if($_POST['username'] && strlen($_POST['username']) >= 3){
$query = mysql_query(
Re: [php] Registartion help [php]
okay. so i didnt quite understand your limit however heres your problem.
PHP Code:
$query = mysql_query("SELECT id FROM users WHERE username=$_POST['username'] LIMIT 1");
you dont need . for variables in mysql. or thats how it works for me.
i suggest making a variable for it though before. for example.
PHP Code:
$username = $_POST['username'];
and then just put $username
hope that helps!
edit:
i found more errors.
PHP Code:
$mysql_user = "root";
$mysql_pass = "";
$mysql_host = "localhost";
$mysql_dbn = "simple webs";
that should do it.
Re: [php] Registartion help [php]
Please buy a book or read some tutorials about PHP. If you can't even fix some misplaced quotes yourself, I doubt if you really want to learn PHP. Have you actually looked at your code? Line 12? Look at the code-highlighting...it's wrong eh? That indicates some misplaced / forgotten quotes.
Closed.