Welcome Guest, Not a member yet? Register   Sign In
'Select where string/integer = something': does it matter if it's a string or int?
#1

[eluser]codex[/eluser]
I tend to use integers to store stuff like options in the DB. For example:

$brand[0] = 'Chevrolet';
$brand[1] = 'Buick';
$brand[2] = 'Ford';

To store a carbrand I may store '2', which corresponds with 'Ford' etc. And to echo the brandname I do $brand[$result_from_db].

Pretty straight forward stuff and it works fine, but when looking at raw data in the database it doesn't make any sense, you only see integers and you don't know what they mean, unless you have the conversion table next to you. It would make far more sense if the data was stored as a string, but does it matter how you store it performance wise?


Messages In This Thread
'Select where string/integer = something': does it matter if it's a string or int? - by El Forum - 06-04-2008, 08:06 PM



Theme © iAndrew 2016 - Forum software by © MyBB