在类中使用当前的mysql连接[关闭]

I'm trying to write a class that will fetch table columns and eval them as variables with the data in that column. I can't seem to get mysql_query() to work inside the class. Does it not work because mysql_query() is an outside function?

class the_info {
    function the_info() {
        $s = mysql_query("bla bla bla");
        while ($r = mysql_fetch_array($s)) {
            $out .= $r[0];
        }
    }
}

$f = new the_info();
echo $f->out;

Something like that. I know I didn't declare vars.

mysql_query() is an inbuild PHP function, it has nothing to do with your custom classes. May be there might be problem with query that you are using. Paste some code !!