connect_error) { die("Connection failed: " . $conn->connect_error); } // If search is available $search =""; // echo $_GET["search"]; $id = ""; if(!empty($_GET["id"])) { $id = mysqli_real_escape_string($conn, $_GET['id']); $search = " and itemdetails.id = '".$_GET['id']."'"; } //echo $search; // Get view count function GetSetCount($myid,$conn) { $viewcount = 0; $sql = "select viewcount from itemdetails where id='$myid'"; //echo $sql; $result = $conn->query($sql); if ($result->num_rows > 0) { $row = $result->fetch_assoc(); $viewcount = $row["viewcount"]; } $updateviewcount = $viewcount + 1; $sql = "update itemdetails set viewcount = $updateviewcount where id = $myid"; //echo $sql; $conn->query($sql); return $viewcount; } $views = GetSetCount($id,$conn); // end view count $sql = ""; $title = ""; $maxdays = " and posteddate > DATE_SUB(CURDATE(), INTERVAL 60 DAY) "; if (!isset($_SESSION['isAdmin'])) { // user is not admin, show only approved $sql = "SELECT *,itemdetails.id as itemid, users.id as myuserid FROM itemdetails,location,users where users.id = itemdetails.userid and deleted = 0 and itemdetails.locationid = location.id ".$search." and approved = '1' $maxdays order by adtype desc, itemdetails.id desc"; } else { // user is admin, show all. $sql = "SELECT *,itemdetails.id as itemid, users.id as myuserid FROM itemdetails,location,users where users.id = itemdetails.userid and itemdetails.locationid = location.id ".$search." $maxdays order by adtype desc, itemdetails.id desc"; echo $sql; } $result1 = $conn->query($sql); if ($result1->num_rows > 0) { // output data of each row while($row1 = $result1->fetch_assoc()) { $title = $row1["itemtitle"]." | FastBikri.com"; $url = $site."ads?id=".$row1["itemid"]; $desc = substr($row1["itemdesc"], 0, 75)."..."; $imagesrc = "upload/".$row1["myuserid"].md5($row1["itemid"]).".jpg"; if (file_exists($imagesrc)) { $image = $site.$imagesrc; } } } ?> FastBikri.com - Buy and Sell Electronics, Properties, Cars & more

( ! ) Warning: Undefined variable $conn in /home/fastyqnj/public_html/ads.php on line 101
Call Stack
#TimeMemoryFunctionLocation
10.0003360904{main}( ).../ads.php:0

( ! ) Fatal error: Uncaught Error: Call to a member function query() on null in /home/fastyqnj/public_html/ads.php on line 101
Call Stack
#TimeMemoryFunctionLocation
10.0012367248newrelic_exception_handler( $exception = class Error { protected $message = 'Call to a member function query() on null'; private string $string = 'Error: Call to a member function query() on null in /home/fastyqnj/public_html/ads.php:101\nStack trace:\n#0 {main}'; protected $code = 0; protected string $file = '/home/fastyqnj/public_html/ads.php'; protected int $line = 101; private array $trace = []; private ?Throwable $previous = NULL; public $xdebug_message = '<tr><th align=\'left\' bgcolor=\'#f57900\' colspan="5"><span style=\'background-color: #cc0000; color: #fce94f; font-size: x-large;\'>( ! )</span> Error: Call to a member function query() on null in /home/fastyqnj/public_html/ads.php on line <i>101</i></th></tr>\n<tr><th align=\'left\' bgcolor=\'#e9b96e\' colspan=\'5\'>Call Stack</th></tr>\n<tr><th align=\'center\' bgcolor=\'#eeeeec\'>#</th><th align=\'left\' bgcolor=\'#eeeeec\'>Time</th><th align=\'left\' bgcolor=\'#eeeeec\'>Memory</th><th align=\'left\' bgcolor=\'#eeeeec\'>Function</t'... } ).../Unknown:0
( ! ) Error: Call to a member function query() on null in /home/fastyqnj/public_html/ads.php on line 101
Call Stack
#TimeMemoryFunctionLocation
10.0003360904{main}( ).../ads.php:0