Posts: 719
Threads: 72
Joined: Mar 2003
I need to test it, and see where the bugs are
http://atosoftqb.digitalblackie.com
>> login
>> Not a member? Join Here
>> Agree
>> User info
Oz~
Posts: 719
Threads: 72
Joined: Mar 2003
i keep getting this messege:
Quote:1136: Column count doesn't match value count at row 1
Oz~
Posts: 2,765
Threads: 138
Joined: Nov 2002
If you are willing can we see some source?
Back by popular demand!
I will byte and nibble you bit by bit until nothing remains but crumbs.
Posts: 719
Threads: 72
Joined: Mar 2003
I'll post some source, but for privacey reasons, i will star-out the username, password, and database name.
just give me a sec, and I will edit this post...
Oz~
Edit:
Code: <HTML>
<HEAD>
<TITLE>AtosoftQb Homepage</TITLE>
</HEAD>
<BODY bgcolor="White" text="Black" link="#004080" vlink="#004080" alink="#004080">
<?
require("header.htm");
$username=$_POST['duser'];
$email=$_POST['email'];
$password=$_POST['pswrd'];
$conn = mysql_connect("localhost" , "****" , "****");
if ($conn == false)
{
echo mysql_errno() . ": " . mysql_error() . "<BR>";
exit;
}
@mysql_select_db("****") or die( "Unable to select database");
$query = "INSERT INTO userdata VALUES ('','$username','password','$email','','0')";
mysql_query($query);
$result = mysql_db_query ("****", $query);
if ($result){
echo "User successfully created! <br> Please click on login on the top menu to continue";
}
else {
echo mysql_errno().": ".mysql_error()."<BR>";
}
mysql_close ();
Require("footer.htm");
?>
</BODY>
</HTML>
Posts: 2,765
Threads: 138
Joined: Nov 2002
3 things
Your INSERT INTO is incorrect syntax
password should be $password
encrypt the password
[syntax="PHP"]$query = "INSERT INTO userdata VALUES ('','$username','password','$email','','0')"; [/syntax]
should be something like:
[syntax="PHP"]$query = "INSERT INTO userdata (``, `username`, `password`, `email`, `whateverthisthingis`) VALUES ('','$username','$password','$email','','0')"; [/syntax]
Back by popular demand!
I will byte and nibble you bit by bit until nothing remains but crumbs.
Posts: 2,771
Threads: 96
Joined: Oct 2003
Quote:[syntax="PHP"]$query = "INSERT INTO userdata VALUES ('','$username','password','$email','','0')"; [/syntax]
should be something like:
[syntax="PHP"]$query = "INSERT INTO userdata (``, `username`, `password`, `email`, `whateverthisthingis`) VALUES ('','$username','$password','$email','','0')"; [/syntax]
No, wt, actually you dont need that. You can just leave it as it was. The Mysql call doesnt require you to tell what fields you are inserting to.
Posts: 719
Threads: 72
Joined: Mar 2003
I haven't encrypted the passwords, because the site won't do PMing, or anything major. It'll just be for posting stupid things, and downloading (so i can keep track of whats hot and whats crap).
Oz~
Posts: 2,771
Threads: 96
Joined: Oct 2003
Oz, the whole point of encrypting the password is so that **you** yourself cant see everyones passwords. Do you really i think id register if it let you know my password? I use that password for everything!
Posts: 2,765
Threads: 138
Joined: Nov 2002
Quote:No, wt, actually you dont need that. You can just leave it as it was. The Mysql call doesnt require you to tell what fields you are inserting to.
Whoops Didn't know that. But still password should be $password =P
Back by popular demand!
I will byte and nibble you bit by bit until nothing remains but crumbs.
Posts: 719
Threads: 72
Joined: Mar 2003
@darkp: I have no use in looking @ ur password, nor would i use it.
i suppose that is hard to believe, since u don't personally know me...meh
Oz~
|