registration/email activation tut

Post here is you are having problems with any of the tutorials.
Post Reply
shaunthomson
Posts: 19
Joined: Mon Nov 28, 2011 11:53 am

registration/email activation tut

Post by shaunthomson »

Hi guys

Regarding the registration/email activation tut...

Say the user activates, and then they hit the activation link in their email again. Why does mysql NOT throw a warning after the
mysql_query("DELETE FROM `user_activations` WHERE `activation_code` = '{$aid}'");
query? ie - the activation code that you're asking it to delete isn't there anymore - so shouldn't a warning or some sort of error come up?

I ask as I've added more things to complete in the activation, each one checking for an error. I noticed that clicking the activation link AFTER the account has been activated resulted in processes in my code being carried out that shouldn't if the user is already activated.

Thanks again!

Shaun
User avatar
jacek
Site Admin
Posts: 3262
Joined: Thu May 05, 2011 1:45 pm
Location: UK
Contact:

Re: registration/email activation tut

Post by jacek »

Because it is not an error.

This of the process the server goes through when deleting rows, first it will check for all rows that match the condition after the WHERE part, then it will delete all of those rows. If there are no matching rows, it just exits.
Image
shaunthomson
Posts: 19
Joined: Mon Nov 28, 2011 11:53 am

Re: registration/email activation tut

Post by shaunthomson »

Ahh - thanks Jacek. I've set it up to test for the number of rows now.

Thanks again for the tuts - I knew nothing about accessing and interacting with mysql before, but now am able to make something useful.

Much appreciated

Shaun
Post Reply