I need something like this.
$mysqli = new mysqli($bd_host, $bd_user, $bd_password);
class webFile {
function __construct($querystr){
if ($result = $this->$mysqli->query($querystr)) {
while( $row = $result->fetch_assoc() ){ echo $row['name']; }
$result->close();
}}}
$object = new webFile($querystr);
I try in different variants, but somethink do not work.
I interested in mysqli->query
not mysqli_query(a,b);
UPD 1. Your solutions not work. 2. Thanks, work fine, the problem was with DB also.