i've searched , searched , tried things i've read reason query fails when using variable rather hardcoded value.
this query:
$bugzilla_query="select * profiles userid='".$bugzilla_id."'";
i getting value of cookie doing following:
$bugzilla_id = $_cookie["bugzilla_login"];
i starting doubt query wrong variable holding cookie value not retrieving correctly though looks correct again if set $bugzilla_id = 642;
still doesn't work if $bugzilla_query="select * profiles userid=642";
works perfectly.
hmm, confused!
you never want put value modified user directly query, in general. additionally if that's supposed number, why putting in single quotes in variable enabled query, not in hard coded one? notice difference? try this:
$bugzilla_query = sprintf("select * profiles userid = %d", $bugzilla_id);
that'll make sure it's cast integer before going query.
Comments
Post a Comment