0

The code works fine locally but fails online:

Fatal error: Uncaught Error: Call to a member function fetchColumn() on boolean in /home/xxxxx/public_html/xxxx/yyyy/index.php:30 Stack trace: #0 {main} thrown in /home/xxxx/public_html/xxxx/yyyy/index.php....

@$eu = ($start - 0); 
$limit = 24;          
$this1 = $eu + $limit; 
$back = $eu - $limit; 
$next = $eu + $limit; 
$pro = $next + 1; 
$ant = $back + 1; 

$query=" select distinct(me_image.gal_id),file_name, gallery,img_id  from me_image,  me_gallery where me_image.gal_id=me_gallery.gal_id group by me_image.gal_id order by gal_id desc limit $eu, $limit";

$query2=" select distinct(me_image.gal_id),file_name, gallery,img_id  from me_image,  me_gallery where me_image.gal_id=me_gallery.gal_id group by me_image.gal_id order by gal_id ";

$nume = $dbo->query("$query2")->fetchColumn();
craigcaulfield
  • 3,381
  • 10
  • 32
  • 40
nwebhead
  • 1
  • 2
  • 1
    Your query failed. Break that call chain apart, check the status, and check the error message. – Sammitch Sep 03 '19 at 03:01
  • `$dbo->query("$query2")` is returning a `false` (the boolean value) not an object. Check the SQL, make sure table and database and column names are all correct, etc – ivanivan Sep 03 '19 at 03:03
  • Possible duplicate of [My PDO Statement doesn't work](https://stackoverflow.com/questions/32648371/my-pdo-statement-doesnt-work) – Dharman Sep 03 '19 at 08:28

1 Answers1

0

Export the db from local and import it to the remote (to be sure they the same), make sure to change the connection settings to db on remote code.

Check php and mysql version on local and remote, in case they are the same, and the above steps are done, yet you get the error, most probably you missing some php configurations on the remote.