Jump to content

I have a small problem


incredibale3

Recommended Posts

I've just realised something... It's the e-mail address. It doesn't realise if there's already the same e-mail address in the database. And it can't find the e-mail to log in. I highly doubt this is a coincidence.

Link to comment
Share on other sites

One thing that helps me in debugging my SQL/PHP is to actually just print it out to the browser window, i.e., $sql = "SOME SQL STATEMENT"; and then just echo $sql; it if it fails, just for troubleshooting of course.

Link to comment
Share on other sites

Gah, this is insanely annoying, I was supposed to be done ages ago, but both asp login/registering systems and php login/registering systems alike despise me...

Link to comment
Share on other sites

The code that I originally posted in that other thread works, you should be able to copy and paste that code, set up the database, enter your database information, and it will work. If you're changing the code around, then that's where you are introducing problems. If you've modified the code from what I posted, post the code that you're working with now.

Link to comment
Share on other sites

The only way i've modded it is with the or die functions that you advised me to..The way I see it is it can't be the query, it makes accounts.It can't be the code, it's much to simple to break..And that leaves nothing but my website hating the mysql_fetch_assoc() part.and also, when the registering is done, it goes to register.php/thankyou.php and doesn't work in that term, but otherwise actually makes an account.

Link to comment
Share on other sites

Wait, I think i found something. Look at the result from running the query in SQLShowing rows 0 - 0 (1 total, Query took 0.0005 sec)and look at the code line: if (mysql_num_rows($result) > 0)Since it says 0-0 rows, shouldn't that make the whole thing mess up, and cause it not to recognize if there's already more than one email? Or am I looking at it wrong, and it counts the total? Because that's the only thing that's not working with the registration, it figuring out if there's already an email address like the one they're typing. Of course, it's related to the login system's issue with finding the email..

Link to comment
Share on other sites

Well, if there aren't any results being returned then it's not finding what it's looking for. What query are you running that's returning 0 results? Have you looked in the table to see what records are in there? I'll bet you'll find that there aren't any records that it's looking for, which is why it's not returning anything.

Link to comment
Share on other sites

No, it's returning a result, but at the top it says 0-0 rows, which should make it not work if my logic is correct.

Link to comment
Share on other sites

It returns the right result, but at the top it says Showing rows 0 - 0 (1 total, Query took 0.0005 sec)and the code is if (mysql_num_rows($result) > 0)So, since it says rows 0-0, couldn't that be a problem? Or does it run off of the 1 total part?

Link to comment
Share on other sites

The mysql_num_results function returns how many results are in the result set. If there is one result then the function will return 1. It will return 0 if there are no results. In phpMyAdmin the row numbering starts at 0, so the first row is row 0.

Link to comment
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...