part1: why i have this error
Fatal error: Cannot use object of type mysqli_result as array in
can anyone help me with this ?
when i run this query i get that error
$checkuser = $c->query("select * from user where(email = 'test@test.com' or mobile = '0933' or username = 'test') limit 1") or die("$c->error");
$c is function to do this=
function db(){
$dbname = 'ro****';
$dbuser = 'roy*****2_fb';
$dbpass = '#******s';
$dbhost = 'localhost';
$mysqli = new mysqli($dbhost, $dbuser, $dbpass, $dbname) or die('Cant connect to Database Server');
$mysqli->query("SET NAMES utf8");
$mysqli->query("SET CHARACTER_SET utf8");
return $mysqli;
}
$c = db();
part2:
and guys there is anyway to get $header in code below:
<?php
$header = 1;
?>
<div id="content">
</div>
<script>$.ajax({url:mypage.php,success:function(loaddataa){
$('#content').html(loaddataa);</script>
and in mypage.php
<? echo $header ?>
but its not get $header when its loaded with ajax
i actully try to load page without header and footer and do query just 1 time in header but i cant get in pages loaded with ajax
its have anyway?