PHP/MySQL code working on local host with MySQL version 5.5.34, but not working on server with MySQL version 5.5.40-36. What is wrong with the code? -


i have code works on localhost connecting godaddy database, when put on godaddy server, not work. needs changed make work? know connection database works because have php file retrieves items no problem.

it connects db, tries execute following code:

try {   $dbh = new pdo($dns, $user, $pass); $dbh->setattribute(pdo::attr_errmode, pdo::errmode_exception);  //$pdo = new pdo("mysql:host=$hostname;dbname=$database", $username, $password);  $items = [];  $start = isset($_get['start']) ? (int)$_get['start'] -1 : 0; $count = isset($_get['count']) ? (int)$_get['count'] : 1;  $item = $dbh->query("select sql_calc_found_rows * portfolio_items limit $start, $count"); $itemstotal = $dbh->query("select found_rows() count")->fetch(pdo::fetch_assoc)['count'];  if($itemscount = $item->rowcount()) {     $items = $item->fetchall(pdo::fetch_obj); }  echo json_encode(array(     'items' => $items,     'last' => ($start + $count) >= $itemstotal ? true : false,     'start' => $start,     'count' => $count     ));  } catch (pdoexception $e) {     error_reporting(e_all); }  ?> 


Comments

Popular posts from this blog

cakephp - simple blog with croogo -

How to group boxplot outliers in gnuplot -

bash - Performing variable substitution in a string -