/ Published in: PHP
retrieve only one value from the query
Expand |
Embed | Plain Text
function execute_scalar($sql,$def="") { return $r[0]; } return $def; }
Comments
Subscribe to comments
You need to login to post a comment.
retrieve only one value from the query
function execute_scalar($sql,$def="") { return $r[0]; } return $def; }
Subscribe to comments
You need to login to post a comment.
If I'm not mistaken your "mysqlfreeresult($rs);" will never be executed because your "return $r[0];" before calling it. The function will immediately stop and return at that point.
right. I've removed it. Thanks.