On Oct 11, 2008, at 1:08 PM, chellieclk wrote:
> Hi Everyone. I am having a bit of a mysterious error that I cannot
> find a solution to.
> I can manually assign a value to $uid and everything works. With a
> var though, I keep
> getting an error about mysql _query not having a valid resource
> $sql = "SELECT u_name FROM members WHERE u_name = {$uid}";
in general this should be the correct way:
$sql = "SELECT u_name FROM members WHERE u_name = ".$uid;
if you are paranoid you should go for typecasting:
$sql = "SELECT u_name FROM members WHERE u_name = ".(int)$uid;
if you are paranoid
Hi Everyone. I am having a bit of a mysterious error that I cannot find a
solution to.
I can manually assign a value to $uid and everything works. With a var though,
I keep
getting an error about mysql _query not having a valid resource.
I cannot get variables to work in my sql statements; I ha