[Tutorial] MySQL Registration System [Threaded Queries(R33+) + Whirlpool]
#11

The better option would be to select all the data once and assign them if there are rows. In the login, you already got the password so compare it and you're done.

Few notes:
- Reset variables on connect.
- Instead of cache_get_data and storing the rows and fields to 2 variables, you could use directly cache_num_rows function:
pawn Code:
if (cache_num_rows()) // if (rows)
Also keep in mind about race condition attacks with threaded queries.

Quote:
Originally Posted by Lordz™
View Post
Nice, well explained. But in case if there's too much fields, it's better to use functions like cache_get_field_content, cache_get_field_content_int, cache_get_field_content_float, etc. So that the user who uses won't get confused in knowing the field ID.
Using the field's index instead of the name is faster, but yes - it depends on the user!
Reply


Messages In This Thread
MySQL Registration System [Threaded Queries + Whirlpool] - by newbienoob - 05.01.2014, 05:36
Re: MySQL Registration System [Threaded Queries(R33+) + Whirlpool] - by SyntaxQ - 05.01.2014, 05:46
Re: MySQL Registration System [Threaded Queries(R33+) + Whirlpool] - by Ryan_Bowe - 05.01.2014, 07:19
Re: MySQL Registration System [Threaded Queries(R33+) + Whirlpool] - by Lordzy - 05.01.2014, 07:27
Re: MySQL Registration System [Threaded Queries(R33+) + Whirlpool] - by iZN - 05.01.2014, 07:30
Re: MySQL Registration System [Threaded Queries(R33+) + Whirlpool] - by newbienoob - 05.01.2014, 09:51
Re: MySQL Registration System [Threaded Queries(R33+) + Whirlpool] - by dusk - 05.01.2014, 10:34
Re: MySQL Registration System [Threaded Queries(R33+) + Whirlpool] - by ]Rafaellos[ - 06.01.2014, 07:08
Re: MySQL Registration System [Threaded Queries(R33+) + Whirlpool] - by iZN - 06.01.2014, 07:20
Re: MySQL Registration System [Threaded Queries(R33+) + Whirlpool] - by Vince - 06.01.2014, 10:10
Re: MySQL Registration System [Threaded Queries(R33+) + Whirlpool] - by Konstantinos - 06.01.2014, 10:34
Re: MySQL Registration System [Threaded Queries(R33+) + Whirlpool] - by maddinat0r - 06.01.2014, 16:33
Re: MySQL Registration System [Threaded Queries(R33+) + Whirlpool] - by anou1 - 06.01.2014, 19:19
Re: MySQL Registration System [Threaded Queries(R33+) + Whirlpool] - by Konstantinos - 06.01.2014, 19:40
Re: MySQL Registration System [Threaded Queries(R33+) + Whirlpool] - by anou1 - 06.01.2014, 19:44
Re: MySQL Registration System [Threaded Queries(R33+) + Whirlpool] - by newbienoob - 07.01.2014, 03:04
Re: MySQL Registration System [Threaded Queries(R33+) + Whirlpool] - by anou1 - 07.01.2014, 18:26
Re: MySQL Registration System [Threaded Queries(R33+) + Whirlpool] - by iZN - 07.01.2014, 18:59
Re: MySQL Registration System [Threaded Queries(R33+) + Whirlpool] - by anou1 - 07.01.2014, 19:05
Re: MySQL Registration System [Threaded Queries(R33+) + Whirlpool] - by PowerPC603 - 27.01.2014, 13:20
Re: MySQL Registration System [Threaded Queries(R33+) + Whirlpool] - by Konstantinos - 27.01.2014, 13:33
Re: MySQL Registration System [Threaded Queries(R33+) + Whirlpool] - by Konstantinos - 04.02.2014, 21:00
Re: MySQL Registration System [Threaded Queries(R33+) + Whirlpool] - by Blast3r - 04.02.2014, 21:08
Re: MySQL Registration System [Threaded Queries(R33+) + Whirlpool] - by PowerPC603 - 04.02.2014, 21:36
Re: MySQL Registration System [Threaded Queries(R33+) + Whirlpool] - by Dorito - 08.02.2014, 07:07
Re: MySQL Registration System [Threaded Queries(R33+) + Whirlpool] - by Zinedine - 08.02.2014, 16:18
Re: MySQL Registration System [Threaded Queries(R33+) + Whirlpool] - by Konstantinos - 08.02.2014, 16:23
Re: MySQL Registration System [Threaded Queries(R33+) + Whirlpool] - by Zinedine - 08.02.2014, 16:25
Re: MySQL Registration System [Threaded Queries(R33+) + Whirlpool] - by Zinedine - 09.02.2014, 00:12
Re: MySQL Registration System [Threaded Queries(R33+) + Whirlpool] - by Ryan_Undering - 20.02.2014, 17:21
Re: MySQL Registration System [Threaded Queries(R33+) + Whirlpool] - by Konstantinos - 20.02.2014, 17:29
Re: MySQL Registration System [Threaded Queries(R33+) + Whirlpool] - by jordyvc - 25.03.2014, 16:04
Re: MySQL Registration System [Threaded Queries(R33+) + Whirlpool] - by Konstantinos - 25.03.2014, 16:13
Re: MySQL Registration System [Threaded Queries(R33+) + Whirlpool] - by newbienoob - 25.03.2014, 16:17
Re : MySQL Registration System [Threaded Queries(R33+) + Whirlpool] - by Cam972 - 25.03.2014, 17:01
Re: Re : MySQL Registration System [Threaded Queries(R33+) + Whirlpool] - by newbienoob - 25.03.2014, 17:18
Re : MySQL Registration System [Threaded Queries(R33+) + Whirlpool] - by Cam972 - 25.03.2014, 18:10
Re: MySQL Registration System [Threaded Queries(R33+) + Whirlpool] - by Konstantinos - 25.03.2014, 19:50
Re : MySQL Registration System [Threaded Queries(R33+) + Whirlpool] - by Cam972 - 28.03.2014, 17:53
Re : MySQL Registration System [Threaded Queries(R33+) + Whirlpool] - by Cam972 - 30.03.2014, 17:04
Re : MySQL Registration System [Threaded Queries(R33+) + Whirlpool] - by Maxime_Creteur - 05.04.2014, 07:50
Re: MySQL Registration System [Threaded Queries(R33+) + Whirlpool] - by Thomixio - 24.07.2014, 17:40
Re: MySQL Registration System [Threaded Queries(R33+) + Whirlpool] - by adithegman - 25.08.2014, 09:04
Re: MySQL Registration System [Threaded Queries(R33+) + Whirlpool] - by FlipperK119 - 29.08.2014, 22:12
AW: MySQL Registration System [Threaded Queries(R33+) + Whirlpool] - by klaus1n3 - 21.09.2014, 03:20
Re: MySQL Registration System [Threaded Queries(R33+) + Whirlpool] - by JeaSon - 21.09.2014, 05:29
Re: MySQL Registration System [Threaded Queries(R33+) + Whirlpool] - by TakeiT - 21.09.2014, 06:03
Re: MySQL Registration System [Threaded Queries(R33+) + Whirlpool] - by Baltimore - 21.09.2014, 13:52
Re: MySQL Registration System [Threaded Queries(R33+) + Whirlpool] - by WopsS - 21.09.2014, 13:53
Re: MySQL Registration System [Threaded Queries(R33+) + Whirlpool] - by Baltimore - 21.09.2014, 14:05
Re: MySQL Registration System [Threaded Queries(R33+) + Whirlpool] - by JeaSon - 22.09.2014, 06:29
Re: MySQL Registration System [Threaded Queries(R33+) + Whirlpool] - by StegooPs - 25.09.2014, 11:02
Re: MySQL Registration System [Threaded Queries(R33+) + Whirlpool] - by Justinclaveria123 - 10.10.2014, 08:39
Re: MySQL Registration System [Threaded Queries(R33+) + Whirlpool] - by zwoorelook - 11.10.2014, 17:03
Re: MySQL Registration System [Threaded Queries(R33+) + Whirlpool] - by Vince - 11.10.2014, 18:31
Re: MySQL Registration System [Threaded Queries(R33+) + Whirlpool] - by Ryz - 06.01.2015, 04:55
Re: MySQL Registration System [Threaded Queries(R33+) + Whirlpool] - by Bondage - 13.01.2015, 13:54
Re: MySQL Registration System [Threaded Queries(R33+) + Whirlpool] - by AgusZ - 16.01.2015, 05:54
Re: MySQL Registration System [Threaded Queries(R33+) + Whirlpool] - by VenomMancer - 01.02.2015, 12:16
Re: MySQL Registration System [Threaded Queries(R33+) + Whirlpool] - by Nicker - 01.02.2015, 12:41
Re: MySQL Registration System [Threaded Queries(R33+) + Whirlpool] - by VenomMancer - 02.02.2015, 10:25
Re: MySQL Registration System [Threaded Queries(R33+) + Whirlpool] - by AchievementMaster360 - 05.03.2015, 02:24
Re: MySQL Registration System [Threaded Queries(R33+) + Whirlpool] - by AroseKhanNiazi - 09.03.2015, 10:05
Re: MySQL Registration System [Threaded Queries(R33+) + Whirlpool] - by Dorito - 21.03.2015, 09:26
Re: MySQL Registration System [Threaded Queries(R33+) + Whirlpool] - by BR3TT - 30.03.2015, 13:57
Re: MySQL Registration System [Threaded Queries(R33+) + Whirlpool] - by BleverCastard - 30.03.2015, 15:01
Re: MySQL Registration System [Threaded Queries(R33+) + Whirlpool] - by BR3TT - 30.03.2015, 22:56
Re: MySQL Registration System [Threaded Queries(R33+) + Whirlpool] - by naveen - 20.04.2015, 10:21
Re: MySQL Registration System [Threaded Queries(R33+) + Whirlpool] - by BleverCastard - 20.04.2015, 15:50
Re: MySQL Registration System [Threaded Queries(R33+) + Whirlpool] - by naveen - 04.05.2015, 14:18
Re: MySQL Registration System [Threaded Queries(R33+) + Whirlpool] - by DarkLouis - 07.05.2015, 16:26
Re: MySQL Registration System [Threaded Queries(R33+) + Whirlpool] - by Konstantinos - 07.05.2015, 16:29
Re: MySQL Registration System [Threaded Queries(R33+) + Whirlpool] - by DarkLouis - 07.05.2015, 16:31
Re: MySQL Registration System [Threaded Queries(R33+) + Whirlpool] - by DarkLouis - 07.05.2015, 16:38
Re: MySQL Registration System [Threaded Queries(R33+) + Whirlpool] - by DarkLouis - 07.05.2015, 16:59
Re: MySQL Registration System [Threaded Queries(R33+) + Whirlpool] - by BigGroter - 16.05.2015, 23:24
Re: MySQL Registration System [Threaded Queries(R33+) + Whirlpool] - by Jihanz - 14.11.2015, 12:55
Re: MySQL Registration System [Threaded Queries(R33+) + Whirlpool] - by Celirius - 15.04.2016, 22:35
Re: MySQL Registration System [Threaded Queries(R33+) + Whirlpool] - by BennyX - 26.12.2016, 18:31

Forum Jump:


Users browsing this thread: 1 Guest(s)