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.