Home Community Mys-Script Creative Off-Topic |
|
|
Thread Tools | Display Modes |
#1
|
||||
|
||||
Using code instead of ID for pet management
I noticed there's a code generator already and pets do have codes. I was thinking if it was possible to use the already available codes to manage pets instead of the ID. I'm worried about the function generating repeated codes and issues, so I wanted to ask first if it's safe to use it? I can always compare all used codes in all tables (might be easier to just create a new one with all the used codes), but the thought of comparing a lot of entries each time an egg is created makes me sweat
__________________
asp.net stole my soul. Last edited by IntoRain; 08-24-2013 at 02:50 PM. |
#2
|
||||
|
||||
Its not safe to use the code unfortunately. The code is a legacy data column that was unused since the day I was working on this script, weird though. The script checks ID for being numeric, thats why the code should not be used for adoptables identity. The field 'code' will be removed in Mys v1.4.0 btw.
__________________
Mysidia Adoptables, a free and ever-improving script for aspiring adoptables/pets site. |
#3
|
||||
|
||||
Alright, thank you :) I was planning on removing all those verifications but I see that the ID is used a lot in a lot of different files, it might bring some problems I don't really feel like solving xD I might change to code later on once I finish the important modifications and if I remember some other way to avoid repeated codes
Thank you
__________________
asp.net stole my soul. |
#4
|
||||
|
||||
You are welcome, in fact I do recall a user called SilverDragonTears used to be able to figure out a way to have a long string of characters as ID rather than simple numbers. It may not be easy with the latest script though.
__________________
Mysidia Adoptables, a free and ever-improving script for aspiring adoptables/pets site. |
#5
|
||||
|
||||
The only way I see is to create a random string and compare it with a list of already used codes (to prevent repeated ones), but depending on the site it can be a large quantity of comparisons. Plus changing/removing the is_numeric verifications sounds a bit boring xD I will get to it later on I think, maybe there's a way to do it in SQL
__________________
asp.net stole my soul. |
#6
|
||||
|
||||
Well you can always use the replace_all functionality from an editor if you wish to get rid of is_numeric() for string comparison instead, not sure how long it will take though.
__________________
Mysidia Adoptables, a free and ever-improving script for aspiring adoptables/pets site. |
#7
|
||||
|
||||
When I use it I usually end up replacing some function that wasn't supposed to be corrected xD But it is useful for finding them with ease, I completely forgot about that, thank you again! It will take a while but it's better than scrolling down the code xD
__________________
asp.net stole my soul. |
|
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
Looking for someone to code for me :) | Infernette | Staff Central | 33 | 02-03-2014 04:44 PM |
Site Management Discussion | MikiHeart | Adoptables Buzz | 9 | 10-30-2013 09:08 PM |
PHP Code. | Aasixx | Questions and Supports | 2 | 09-17-2012 05:15 PM |
Could some one code this..? | Abronsyth | Questions and Supports | 5 | 04-13-2012 07:27 PM |
Invite Code/Alpha Code | Shex | Questions and Supports | 0 | 03-07-2011 04:08 AM |
What's New? |
What's Hot? |
What's Popular? |