Im trying to fetch data from mysql but only the first character for each field is loaded. However this only happens when I upload my site to my domain. On localhost it works fine. So i can only assume its a server issue?
my Query is:
$stmt = $mysqli->prepare("SELECT Prd_ID, product_title, model_no, part_no, category_id, subcat_id, weights, ean, condition_id, brand_id, warranty_id, collect_serial, retail, listprice, short_desc, full_desc, tax_class_id, web_status_id FROM product WHERE Prd_ID = ?");
$stmt->bind_param("s", $_GET['pid'] );
$stmt->store_result();
$stmt->bind_result($pid, $product_title, $model_no, $part_no, $category_id, $subcat_id, $weights, $ean, $condition_id, $brand_id, $warranty_id, $collect_serial, $retail, $listprice, $short_desc, $full_desc, $tax_class_id, $web_status_id);
if( $stmt->execute() ) {
// Loads of code.. to much to paste here
}
i have used the following to see the output on both localhost and domain online:
print_r(get_defined_vars(),true);
The following are the results i got.
Localhost
[pid] => 5
[product_title] => HP Envy 15-J140SA Intel Core i5-4200M 8GB 1TB Nvidia GT840 2GB Windows 8.1
[model_no] => 15-J140SA
[part_no] => J0B97EA
[category_id] => 1
[subcat_id] => 2
[weights] => 2.50
[ean] => 0888793319512
[condition_id] => 4
[brand_id] => 19
[warranty_id] => 3
[collect_serial] => 2
[retail] => 599.99
[listprice] => 499.99
[short_desc] =>
[full_desc] =>
[tax_class_id] => 1
[web_status_id] => 2
[row] => 1
)
Online
[pid] => 5
[product_title] => H
[model_no] => 1
[part_no] => J
[category_id] => 1
[subcat_id] => 2
[weights] => 2
[ean] => 0
[condition_id] => 4
[brand_id] => 19
[warranty_id] => 3
[collect_serial] => 2
[retail] => 5.00
[listprice] => 4.00
[short_desc] =>
[full_desc] =>
[tax_class_id] => 1
[web_status_id] => 2
[row] => 1
)
The PHP code is a carbon copy on both sides. (localhost and online) and the databases are the same as well. I've been banging my head tryna figure this out. I'd like to know if this is a server problem since it works fine on localhost.
Thanks in advance.
EDIT:
$row = $stmt->fetch();
if( $pid == $_GET['pid'] ){
// Pre-load details
$isCopy = true;
$product_title = $product_title;
$model_no = $model_no;
$part_no = $part_no;
$category_id = $category_id;
$subcat_id = $subcat_id;
$weights = $weights;
$ean = $ean;
$condition_id = $condition_id;
$brand_id = $brand_id;
$warranty_id = $warranty_id;
$collect_serial = $collect_serial;
$retail = number_format($retail, 2);
$listprice = number_format($listprice, 2);
$short_desc = $short_desc;
$full_desc = $full_desc;
$tax_class_id = $tax_class_id;
$web_status_id = $web_status_id;
$stmt->close();
}