php - Trying to fetch data from mysql but only the first character for each field is loaded. Works Locally but not online -
im trying fetch data mysql first character each field loaded. happens when upload site domain. on localhost works fine. can assume 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 product 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.. paste here } i have used following see output on both localhost , domain online:
print_r(get_defined_vars(),true); the following results 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 carbon copy on both sides. (localhost , online) , databases same well. i've been banging head tryna figure out. i'd know if server problem since 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(); }
solved it. removed $full_desc paramaters , worked. dont know why particular field , nothing else.
Comments
Post a Comment