Hey everyone,
I was wondering, if I have some code such as:
$result = $db->query($sql); // dont worry, its escaped
$myData = (array)$result->fetch_assoc();
where
$result->fetch_assoc();
returns a mysqli result object.
Is casting it like this right away good practice? I would imagine this is an expensive call - is this true?
It sure makes things convenient to use immediately after I query for it, but I want to make sure I'm not doing something in bad form.
Thanks for any input,