Path: csiph.com!fu-berlin.de!uni-berlin.de!individual.net!not-for-mail From: "J.O. Aho" Newsgroups: comp.lang.php Subject: Re: rawurlencode problem Date: Tue, 20 Oct 2015 07:21:28 +0200 Lines: 33 Message-ID: References: Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-Trace: individual.net +wjcExBg25PE/YqKQLOpQgJmDEUfSaXp/bmRlqB+O1LipgRYd2 Cancel-Lock: sha1:wUHZ4jTuD4IbLordaGpk5xWBVxk= User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:38.0) Gecko/20100101 Thunderbird/38.3.0 In-Reply-To: Xref: csiph.com comp.lang.php:15711 On 10/20/2015 07:10 AM, J.O. Aho wrote: > On 10/19/2015 09:43 PM, Derek Turner wrote: >> On Mon, 19 Oct 2015 21:27:54 +0200, J.O. Aho wrote: >> >>> The standard is to use a numeric id in the database, it's a lot easier >>> to validate that it seems to be okey and numeric index in the database >>> is faster than varchar/text based. >>> >>> I would recommend a redesign of your database and it will solve your >>> problem too. >> >> I really don't see how that even begins to answer my question. There is, >> of course, an auto-incrementing integer primary key in all four tables. > > That wasn't in your example and your use of the "name" gave the > impression your database could be flawed. > >> What's that got to do with the question I asked? > > Have you thought of using id as the value, you can always make a new > request to the database to get the name in an unmodified by the user. > You can also check that the is_int() when you get the value posted back > to see if it's possibly a valid value. > Sorry, missed that you post back anything, but still more sane to use the index, as you ALWAYS know the format of it, compare that with a string, which has kind of unlimited formats and characters, one day there may be a character which breaks your anchor again as it's not in your replacement array. -- //Aho