Jump to content


Photo

Registration not working?


  • Please log in to reply
17 replies to this topic

#1 localhost

localhost
  • Members
  • PipPipPip
  • Advanced Member
  • 152 posts

Posted 28 May 2006 - 12:54 PM

Here is my user registration script that I am making from scratch, I am new to PHP btw.

<?php

include('inc/connect.php');


$username = $_POST['username'];
$email = $_POST['email'];
$pass = $_POST['pass'];
$cpass = $_POST['cpass'];
$aim = $_POST['aim'];
$msn = $_POST['msn'];
$yim = $_POST['yim'];
$priv = $_POST['priv'];
$regip = $_POST['regip'];
$regdate = $_POST['regdate'];

if($pass!=$cpass) {
echo "Passwords must match.";
} else {
$query = ("INSERT INTO `users` (`username`, `email`, `pass`, `aim`, `msn`, `yim`, `priv`, `regip`, `regdate`) 
VALUES ('$username', '$email' '$pass', '$aim', '$msn', '$yim', '$priv', '$regip', '$regdate')");
$result = @mysql_query($query) 
        or die("There was a problem with this query:".mysql_error());
}


?>

<form action="" method="POST"> * Indicates a required field
<p>
  <input type="hidden" name="priv" value="1" />
  <input type="hidden" name="regip" value=" <?php echo $_SERVER['REMOTE_ADDR']; ?> " />
  <input type="hidden" name="regdate" value=" <?php echo date('d/m/y'); ?> " />
  *Username: 
  <input type="text" name="username" value="" />
  <BR>
  *eMail: 
  <input type="text" name="email" value="">
  <Br>
  *Password: 
  <input type="password" name="pass" value="">
  <Br>
  *Confirm Password: 
  <input type="password" name="cpass" value="">
  <Br>
  AIM: 
  <input type="text" name="aim" value="">
  <BR>
  MSN: 
  <input type="text" name="msn" value="">
  <br>
  YIM: 
  <input type="text" name="yim" value="">
  <Br>
  <input type="submit" name="submit" value="Register">
</p>


It comes up with this error:

There was a problem with this query:Column count doesn't match value count at row 1

Not sure how to fix it, also I will be asking once I get this fixed and once it starts writing to the database, how I can secure the script and such, also I know it doesn't use any encryption at all, I want it working before I add the md5.

Thanks for any help you may be able to provide!

#2 ToonMariner

ToonMariner
  • Members
  • PipPipPip
  • Advanced Member
  • 3,342 posts
  • LocationNewcastle upon Tyne, UK

Posted 28 May 2006 - 01:07 PM

change your query.

have ALL the fields in the table listed in the fields of teh query and those where no value should be inserted simply have '' in coreesponding values position.

Assuming the only field you have omitted is the unique id and that has autoincrement... do this

$query = ("INSERT INTO `users` (`unique_id`, `username`, `email`, `pass`, `aim`, `msn`, `yim`, `priv`, `regip`, `regdate`)
VALUES ('', '$username', '$email' '$pass', '$aim', '$msn', '$yim', '$priv', '$regip', '$regdate')");

Now some other help for you....

comparing strings - use the strcomp functions instead.

checking user input: use mysql_real_escape_string to prevent mysql injection.

use the sha1 instead of md5 - its just a bit better IMO.
follow me on twitter @PHPsycho

#3 localhost

localhost
  • Members
  • PipPipPip
  • Advanced Member
  • 152 posts

Posted 28 May 2006 - 01:22 PM

As I said, I am completely new to PHP, I have no idea what you are talking about in alot of that, I just replaced my query with the one you posted and I still get the same error.

Also, is sha1 built into php like md5?

#4 WhiteyDude

WhiteyDude
  • Members
  • Pip
  • Newbie
  • 8 posts

Posted 28 May 2006 - 01:34 PM

[!--quoteo(post=377814:date=May 28 2006, 11:22 PM:name=localhost)--][div class=\'quotetop\']QUOTE(localhost @ May 28 2006, 11:22 PM) View Post[/div][div class=\'quotemain\'][!--quotec--]
As I said, I am completely new to PHP, I have no idea what you are talking about in alot of that, I just replaced my query with the one you posted and I still get the same error.

Also, is sha1 built into php like md5?
[/quote]


He means you have to replace the "unique_id" field with your unique id field... Like userID or ID.


Get a description of your table. If you use phpMyAdmin, find the table, go SQL and put in "describe yourtablename" replacing yourtablename with the name of the table.

If you use a command line client (where it says mysql>), put in "use yourdatabase;" and "describe yourtablename;", replacing the relevant bits with your data.



/Whitey

#5 localhost

localhost
  • Members
  • PipPipPip
  • Advanced Member
  • 152 posts

Posted 28 May 2006 - 01:37 PM

I did replace unique_id with just "id".
Which is what it is called. Here is the sql query I used for the script:


CREATE TABLE users (  
           id INT NOT NULL AUTO_INCREMENT PRIMARY KEY,  
           username VARCHAR(255) NOT NULL, 
       email VARCHAR(255) NOT NULL, 
       pass VARCHAR(32) NOT NULL,   
           aim VARCHAR(255) NOT NULL, 
       msn VARCHAR(255) NOT NULL, 
       yim VARCHAR(255) NOT NULL,
       priv VARCHAR(255) NOT NULL,  
           regip VARCHAR(255) NOT NULL,  
           regdate VARCHAR(255) NOT NULL 
           )  
           TYPE = myisam;


#6 legohead6

legohead6
  • Members
  • PipPipPip
  • Advanced Member
  • 434 posts

Posted 28 May 2006 - 02:29 PM

[!--quoteo(post=377808:date=May 28 2006, 07:54 AM:name=localhost)--][div class=\'quotetop\']QUOTE(localhost @ May 28 2006, 07:54 AM) View Post[/div][div class=\'quotemain\'][!--quotec--]
Here is my user registration script that I am making from scratch, I am new to PHP btw.

<?php

include('inc/connect.php');
$username = $_POST['username'];
$email = $_POST['email'];
$pass = $_POST['pass'];
$cpass = $_POST['cpass'];
$aim = $_POST['aim'];
$msn = $_POST['msn'];
$yim = $_POST['yim'];
$priv = $_POST['priv'];
$regip = $_POST['regip'];
$regdate = $_POST['regdate'];

if($pass!=$cpass) {
echo "Passwords must match.";
} else {
$query = ("INSERT INTO `users` (`username`, `email`, `pass`, `aim`, `msn`, `yim`, `priv`, `regip`, `regdate`) 
VALUES ('$username', '$email' '$pass', '$aim', '$msn', '$yim', '$priv', '$regip', '$regdate')");
$result = @mysql_query($query) 
        or die("There was a problem with this query:".mysql_error());
}
?>

<form action="" method="POST"> * Indicates a required field
<p>
  <input type="hidden" name="priv" value="1" />
  <input type="hidden" name="regip" value=" <?php echo $_SERVER['REMOTE_ADDR']; ?> " />
  <input type="hidden" name="regdate" value=" <?php echo date('d/m/y'); ?> " />
  *Username: 
  <input type="text" name="username" value="" />
  <BR>
  *eMail: 
  <input type="text" name="email" value="">
  <Br>
  *Password: 
  <input type="password" name="pass" value="">
  <Br>
  *Confirm Password: 
  <input type="password" name="cpass" value="">
  <Br>
  AIM: 
  <input type="text" name="aim" value="">
  <BR>
  MSN: 
  <input type="text" name="msn" value="">
  <br>
  YIM: 
  <input type="text" name="yim" value="">
  <Br>
  <input type="submit" name="submit" value="Register">
</p>


It comes up with this error:

There was a problem with this query:Column count doesn't match value count at row 1

Not sure how to fix it, also I will be asking once I get this fixed and once it starts writing to the database, how I can secure the script and such, also I know it doesn't use any encryption at all, I want it working before I add the md5.

Thanks for any help you may be able to provide!
[/quote]


change this
$query = ("INSERT INTO `users` (`username`, `email`, `pass`, `aim`, `msn`, `yim`, `priv`, `regip`, `regdate`) 
VALUES ('$username', '$email' '$pass', '$aim', '$msn', '$yim', '$priv', '$regip', '$regdate')");

to this
$query = "INSERT INTO users (`username`, `email`, `pass`, `aim`, `msn`, `yim`, `priv`, `regip`, `regdate`)
VALUES ('$username', '$email' '$pass', '$aim', '$msn', '$yim', '$priv', '$regip', '$regdate')";

or this
$query = "INSERT INTO `users` VALUES ('$username', '$email' '$pass', '$aim', '$msn', '$yim', '$priv', '$regip', '$regdate')";


if your filling out all the spots in the database yiou can use the third one...but i dont know what your database looks likes
"Syntax error" .. WHERE THE **** IS IT?!

#7 localhost

localhost
  • Members
  • PipPipPip
  • Advanced Member
  • 152 posts

Posted 28 May 2006 - 02:33 PM

With this one:

$query = "INSERT INTO users (`username`, `email`, `pass`, `aim`, `msn`, `yim`, `priv`, `regip`, `regdate`)
VALUES ('$username', '$email' '$pass', '$aim', '$msn', '$yim', '$priv', '$regip', '$regdate')";

I still get the same error...present here:
[a href=\"http://www.thecodingplace.com/dl/usersystem/register.php\" target=\"_blank\"]http://www.thecodingplace.com/dl/usersystem/register.php[/a]

#8 legohead6

legohead6
  • Members
  • PipPipPip
  • Advanced Member
  • 434 posts

Posted 28 May 2006 - 02:37 PM

[!--quoteo(post=377830:date=May 28 2006, 09:33 AM:name=localhost)--][div class=\'quotetop\']QUOTE(localhost @ May 28 2006, 09:33 AM) View Post[/div][div class=\'quotemain\'][!--quotec--]
With this one:

$query = "INSERT INTO users (`username`, `email`, `pass`, `aim`, `msn`, `yim`, `priv`, `regip`, `regdate`)
VALUES ('$username', '$email' '$pass', '$aim', '$msn', '$yim', '$priv', '$regip', '$regdate')";

I still get the same error...present here:
[a href=\"http://www.thecodingplace.com/dl/usersystem/register.php\" target=\"_blank\"]http://www.thecodingplace.com/dl/usersystem/register.php[/a]
[/quote]

in values put the comma inbetween 'email' and 'pass' thats likly your problem...or make sure all the colunms in the users are spelt excaxtly the same as youve put them (CAPS too)
"Syntax error" .. WHERE THE **** IS IT?!

#9 localhost

localhost
  • Members
  • PipPipPip
  • Advanced Member
  • 152 posts

Posted 28 May 2006 - 02:47 PM

Works perfectly and writes to the database! Thanks alot, I didn't even notice there wasn't a comma in between email and pass. I have even got sha1 working.

Is there a way to make it so when they hit register, it takes them to a different page?

And how would I do a statement like if username exists state an error message saying this user already exists.

This is my current code:

<?php

include('inc/connect.php');


$username = $_POST['username'];
$email = $_POST['email'];
$pass = $_POST['pass'];
$cpass = $_POST['cpass'];
$aim = $_POST['aim'];
$msn = $_POST['msn'];
$yim = $_POST['yim'];
$priv = $_POST['priv'];
$regip = $_POST['regip'];
$regdate = $_POST['regdate'];

$sec_pass = sha1('$pass');

if($pass!=$cpass) {
echo "Passwords must match.";
} else {
$query = "INSERT INTO users (`username`, `email`, `pass`, `aim`, `msn`, `yim`, `priv`, `regip`, `regdate`)
VALUES ('$username', '$email', '$sec_pass', '$aim', '$msn', '$yim', '$priv', '$regip', '$regdate')";
$result = @mysql_query($query) 
        or die("There was a problem with this query: ".mysql_error());
}


?>

<form action="" method="POST"> * Indicates a required field
<p>
  <input type="hidden" name="priv" value="1" />
  <input type="hidden" name="regip" value=" <?php echo $_SERVER['REMOTE_ADDR']; ?> " />
  <input type="hidden" name="regdate" value=" <?php echo date('m/d/y'); ?> " />
  *Username: 
  <input type="text" name="username" value="" />
  <BR>
  *eMail: 
  <input type="text" name="email" value="">
  <Br>
  *Password: 
  <input type="password" name="pass" value="">
  <Br>
  *Confirm Password: 
  <input type="password" name="cpass" value="">
  <Br>
  AIM: 
  <input type="text" name="aim" value="">
  <BR>
  MSN: 
  <input type="text" name="msn" value="">
  <br>
  YIM: 
  <input type="text" name="yim" value="">
  <Br>
  <input type="submit" name="submit" value="Register">
</p>


#10 legohead6

legohead6
  • Members
  • PipPipPip
  • Advanced Member
  • 434 posts

Posted 28 May 2006 - 02:59 PM

[!--quoteo(post=377834:date=May 28 2006, 09:47 AM:name=localhost)--][div class=\'quotetop\']QUOTE(localhost @ May 28 2006, 09:47 AM) View Post[/div][div class=\'quotemain\'][!--quotec--]
Works perfectly and writes to the database! Thanks alot, I didn't even notice there wasn't a comma in between email and pass. I have even got sha1 working.

Is there a way to make it so when they hit register, it takes them to a different page?

And how would I do a statement like if username exists state an error message saying this user already exists.

This is my current code:

<?php

include('inc/connect.php');
$username = $_POST['username'];
$email = $_POST['email'];
$pass = $_POST['pass'];
$cpass = $_POST['cpass'];
$aim = $_POST['aim'];
$msn = $_POST['msn'];
$yim = $_POST['yim'];
$priv = $_POST['priv'];
$regip = $_POST['regip'];
$regdate = $_POST['regdate'];

$sec_pass = sha1('$pass');

if($pass!=$cpass) {
echo "Passwords must match.";
} else {
$query = "INSERT INTO users (`username`, `email`, `pass`, `aim`, `msn`, `yim`, `priv`, `regip`, `regdate`)
VALUES ('$username', '$email', '$sec_pass', '$aim', '$msn', '$yim', '$priv', '$regip', '$regdate')";
$result = @mysql_query($query) 
        or die("There was a problem with this query: ".mysql_error());
}
?>

<form action="" method="POST"> * Indicates a required field
<p>
  <input type="hidden" name="priv" value="1" />
  <input type="hidden" name="regip" value=" <?php echo $_SERVER['REMOTE_ADDR']; ?> " />
  <input type="hidden" name="regdate" value=" <?php echo date('m/d/y'); ?> " />
  *Username: 
  <input type="text" name="username" value="" />
  <BR>
  *eMail: 
  <input type="text" name="email" value="">
  <Br>
  *Password: 
  <input type="password" name="pass" value="">
  <Br>
  *Confirm Password: 
  <input type="password" name="cpass" value="">
  <Br>
  AIM: 
  <input type="text" name="aim" value="">
  <BR>
  MSN: 
  <input type="text" name="msn" value="">
  <br>
  YIM: 
  <input type="text" name="yim" value="">
  <Br>
  <input type="submit" name="submit" value="Register">
</p>
[/quote]

to move to a new locattion put this

header("Location: page.php");

but make sure the <?PHP is the very first thing at the stop of your page! no <html> before it...or else there will be an error saying headers already sent....

to find if username alrady exist make a new query and result then

while($row = mysql_fletch_array(result2)){
if($username == $row['username']){
do this
}
"Syntax error" .. WHERE THE **** IS IT?!

#11 localhost

localhost
  • Members
  • PipPipPip
  • Advanced Member
  • 152 posts

Posted 28 May 2006 - 03:09 PM

Kind of like this?


<?php

include('inc/connect.php');


$username = $_POST['username'];
$email = $_POST['email'];
$pass = $_POST['pass'];
$cpass = $_POST['cpass'];
$aim = $_POST['aim'];
$msn = $_POST['msn'];
$yim = $_POST['yim'];
$priv = $_POST['priv'];
$regip = $_POST['regip'];
$regdate = $_POST['regdate'];

$invalid = "";

$sec_pass = sha1('$pass');

if($pass!=$cpass || $username==$invalid || $email==$invalid || $pass==$invalid || $cpass==$invalid) {
echo "<font color=red>ERROR: Make sure all fields marked with a * are filled, and that your username and password match.</font><BR>";
} else {
$query = "INSERT INTO users (`username`, `email`, `pass`, `aim`, `msn`, `yim`, `priv`, `regip`, `regdate`)
VALUES ('$username', '$email', '$sec_pass', '$aim', '$msn', '$yim', '$priv', '$regip', '$regdate')";
$result = @mysql_query($query) 
        or die("There was a problem with this query: ".mysql_error());
}

$uquery = while($row = mysql_fetch_array(result2)){
if($username == $row['username']){
echo "Username already taken.";
}
$result = mysql_query($uquery) or die('Username query could not be executed');

header("Location: http://www.google.com");
?>

<form action="" method="POST"> * Indicates a required field
<p>
  <input type="hidden" name="priv" value="1" />
  <input type="hidden" name="regip" value=" <?php echo $_SERVER['REMOTE_ADDR']; ?> " />
  <input type="hidden" name="regdate" value=" <?php echo date('m/d/y'); ?> " />
  *Username: 
  <input type="text" name="username" value="" />
  <BR>
  *eMail: 
  <input type="text" name="email" value="">
  <Br>
  *Password: 
  <input type="password" name="pass" value="">
  <Br>
  *Confirm Password: 
  <input type="password" name="cpass" value="">
  <Br>
  AIM: 
  <input type="text" name="aim" value="">
  <BR>
  MSN: 
  <input type="text" name="msn" value="">
  <br>
  YIM: 
  <input type="text" name="yim" value="">
  <Br>
  <input type="submit" name="submit" value="Register">
</p>


That gives me this error:
Parse error: parse error, unexpected T_WHILE in /home/tcp/public_html/dl/usersystem/register.php on line 30

P.S. - sorry for asking for so much help, I just really want to get some php experience.

#12 legohead6

legohead6
  • Members
  • PipPipPip
  • Advanced Member
  • 434 posts

Posted 28 May 2006 - 03:15 PM

[!--quoteo(post=377845:date=May 28 2006, 10:09 AM:name=localhost)--][div class=\'quotetop\']QUOTE(localhost @ May 28 2006, 10:09 AM) View Post[/div][div class=\'quotemain\'][!--quotec--]
Kind of like this?


<?php

include('inc/connect.php');
$username = $_POST['username'];
$email = $_POST['email'];
$pass = $_POST['pass'];
$cpass = $_POST['cpass'];
$aim = $_POST['aim'];
$msn = $_POST['msn'];
$yim = $_POST['yim'];
$priv = $_POST['priv'];
$regip = $_POST['regip'];
$regdate = $_POST['regdate'];

$invalid = "";

$sec_pass = sha1('$pass');

if($pass!=$cpass || $username==$invalid || $email==$invalid || $pass==$invalid || $cpass==$invalid) {
echo "<font color=red>ERROR: Make sure all fields marked with a * are filled, and that your username and password match.</font><BR>";
} else {
$query = "INSERT INTO users (`username`, `email`, `pass`, `aim`, `msn`, `yim`, `priv`, `regip`, `regdate`)
VALUES ('$username', '$email', '$sec_pass', '$aim', '$msn', '$yim', '$priv', '$regip', '$regdate')";
$result = @mysql_query($query) 
        or die("There was a problem with this query: ".mysql_error());
}

$uquery = while($row = mysql_fetch_array(result2)){
if($username == $row['username']){
echo "Username already taken.";
}
$result = mysql_query($uquery) or die('Username query could not be executed');

header("Location: http://www.google.com");
?>

<form action="" method="POST"> * Indicates a required field
<p>
  <input type="hidden" name="priv" value="1" />
  <input type="hidden" name="regip" value=" <?php echo $_SERVER['REMOTE_ADDR']; ?> " />
  <input type="hidden" name="regdate" value=" <?php echo date('m/d/y'); ?> " />
  *Username: 
  <input type="text" name="username" value="" />
  <BR>
  *eMail: 
  <input type="text" name="email" value="">
  <Br>
  *Password: 
  <input type="password" name="pass" value="">
  <Br>
  *Confirm Password: 
  <input type="password" name="cpass" value="">
  <Br>
  AIM: 
  <input type="text" name="aim" value="">
  <BR>
  MSN: 
  <input type="text" name="msn" value="">
  <br>
  YIM: 
  <input type="text" name="yim" value="">
  <Br>
  <input type="submit" name="submit" value="Register">
</p>


That gives me this error:
Parse error: parse error, unexpected T_WHILE in /home/tcp/public_html/dl/usersystem/register.php on line 30

P.S. - sorry for asking for so much help, I just really want to get some php experience.
[/quote]

the query has to be proper so like this

$query2 = "SELECT * FROM table";
$result2 = @mysql_query($query2);

then the While statement underneath

P.S the best way to gain experiance is to buy a good book! I would recommend "PHP and MySQL for dynamic web sites Second edition" By Larry Ullman
THats what got me going
"Syntax error" .. WHERE THE **** IS IT?!

#13 localhost

localhost
  • Members
  • PipPipPip
  • Advanced Member
  • 152 posts

Posted 28 May 2006 - 03:32 PM

Took a small part this time:

if($pass!=$cpass || $username==$invalid || $email==$invalid || $pass==$invalid || $cpass==$invalid) {
echo "<font color=red>ERROR: Make sure all fields marked with a * are filled, and that your username and password match.</font><BR>";
} else {
$query = "INSERT INTO users (`username`, `email`, `pass`, `aim`, `msn`, `yim`, `priv`, `regip`, `regdate`)
VALUES ('$username', '$email', '$sec_pass', '$aim', '$msn', '$yim', '$priv', '$regip', '$regdate')";
$result = @mysql_query($query) 
        or die("There was a problem with this query: ".mysql_error());
}

$query2 = "SELECT * FROM `users`";
$result2 = mysql_query($query2) or die('Username query could not be executed');
while($row = mysql_fetch_array(result2)){
if($username == $row['username']){
echo "Username already taken.";
}


header("Location: http://www.google.com");
?>

And you can see the error here:
[a href=\"http://www.thecodingplace.com/dl/usersystem/register.php\" target=\"_blank\"]http://www.thecodingplace.com/dl/usersystem/register.php[/a]

Line 68 is just </p>

Anyway about the book, I might buy one soon...I just need to get some cash.

#14 legohead6

legohead6
  • Members
  • PipPipPip
  • Advanced Member
  • 434 posts

Posted 28 May 2006 - 03:53 PM

[!--quoteo(post=377851:date=May 28 2006, 10:32 AM:name=localhost)--][div class=\'quotetop\']QUOTE(localhost @ May 28 2006, 10:32 AM) View Post[/div][div class=\'quotemain\'][!--quotec--]
Took a small part this time:

if($pass!=$cpass || $username==$invalid || $email==$invalid || $pass==$invalid || $cpass==$invalid) {
echo "<font color=red>ERROR: Make sure all fields marked with a * are filled, and that your username and password match.</font><BR>";
} else {
$query = "INSERT INTO users (`username`, `email`, `pass`, `aim`, `msn`, `yim`, `priv`, `regip`, `regdate`)
VALUES ('$username', '$email', '$sec_pass', '$aim', '$msn', '$yim', '$priv', '$regip', '$regdate')";
$result = @mysql_query($query) 
        or die("There was a problem with this query: ".mysql_error());
}

$query2 = "SELECT * FROM `users`";
$result2 = mysql_query($query2) or die('Username query could not be executed');
while($row = mysql_fetch_array(result2)){
if($username == $row['username']){
echo "Username already taken.";
}
header("Location: http://www.google.com");
?>

And you can see the error here:
[a href=\"http://www.thecodingplace.com/dl/usersystem/register.php\" target=\"_blank\"]http://www.thecodingplace.com/dl/usersystem/register.php[/a]

Line 68 is just </p>

Anyway about the book, I might buy one soon...I just need to get some cash.
[/quote]

add a } after header();

"Syntax error" .. WHERE THE **** IS IT?!

#15 localhost

localhost
  • Members
  • PipPipPip
  • Advanced Member
  • 152 posts

Posted 28 May 2006 - 03:56 PM

Ugh so frustrating! I added a } after the header part but now I get this:

[a href=\"http://www.thecodingplace.com/dl/usersystem/register.php\" target=\"_blank\"]http://www.thecodingplace.com/dl/usersystem/register.php[/a]

#16 legohead6

legohead6
  • Members
  • PipPipPip
  • Advanced Member
  • 434 posts

Posted 28 May 2006 - 04:15 PM

[!--quoteo(post=377856:date=May 28 2006, 10:56 AM:name=localhost)--][div class=\'quotetop\']QUOTE(localhost @ May 28 2006, 10:56 AM) View Post[/div][div class=\'quotemain\'][!--quotec--]
Ugh so frustrating! I added a } after the header part but now I get this:

[a href=\"http://www.thecodingplace.com/dl/usersystem/register.php\" target=\"_blank\"]http://www.thecodingplace.com/dl/usersystem/register.php[/a]
[/quote]

lol...ok in the while statement change array to row so

while ($row = mysql_fletch_row(result2)){
}

also to retreave the info

$row[3] but replace 3 with proper number!

thats the only thing i can think off
"Syntax error" .. WHERE THE **** IS IT?!

#17 localhost

localhost
  • Members
  • PipPipPip
  • Advanced Member
  • 152 posts

Posted 28 May 2006 - 04:17 PM

I changed row to array but idk what you mean by row?

#18 legohead6

legohead6
  • Members
  • PipPipPip
  • Advanced Member
  • 434 posts

Posted 28 May 2006 - 04:21 PM

[!--quoteo(post=377856:date=May 28 2006, 10:56 AM:name=localhost)--][div class=\'quotetop\']QUOTE(localhost @ May 28 2006, 10:56 AM) View Post[/div][div class=\'quotemain\'][!--quotec--]
Ugh so frustrating! I added a } after the header part but now I get this:

[a href=\"http://www.thecodingplace.com/dl/usersystem/register.php\" target=\"_blank\"]http://www.thecodingplace.com/dl/usersystem/register.php[/a]
[/quote]

change in the while statement array to row and then change $username to equal $row[n] replace n with row that username is

row is another way to retreave results for a databse(the one i use) it means instead of putting the row name you want to retrieve you put the number.....
"Syntax error" .. WHERE THE **** IS IT?!




0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users