Hi, I am trying to set up a system where by visitors can submit there site with a mini banner to my site. The data needs to be saved in MySQL dadabase table called: site_affiliates_validating. What i have got below works fine, but the only part that doesnt work is the id. Whenever i try to use auto_incriment it will not create the table. I think I have done the rest of it right, but if you spot any errors or things that could be changed, please feel freee to tell me.
The point of the auto increment type is that it automatically increments for you (hence the name) so you don't have to insert it. Each time you insert a new record it is always +1 from the previous value.
If all registrants will be identified with unique ids - and it has to be so for easy referral purposes in every aspect - then do the id column unique. Hence it wont be possible to have 2 same values in id fields. that is the basic.
As for the best way to display, ORDER BY id is very good, but as the latest registrant will be having a bigger id number you have to use ORDER BY id DESC LIMIT 100. Else it will sort as the oldest registrant being the topmost, and it will put data in that order either to screen or to any array.
also why put in all the column names ? use *.
SELECT * FROM site_affiliates_validating WHERE *your query* ORDER BY id DESC LIMIT 100
is better. and i guess youll be probably using this table for only validation of registrants, you might as well use
SELECT * FROM site_affiliates_validating ORDER BY id DESC LIMIT 100
Yes, it is only for validating. Using checkboxes and a select menu, to delete or accept the site. If i accept the site, i need it to move the row(s) to the site_affiliates table and if i dont accept the row needs to be deleted. Im not sure how to go about setting this up but help is appreciated.