Wierd output from mysql_fetch_assoc


#1

I recently migrated php pages from mysql to mysqli. everything runs fine except mysql_fetch_assoc query

while in mysql, during following query I get
..........................................................
$Cus_orders_sql = "SELECT * FROM orders WHERE customer_id LIKE '$customer_id'";
$orders_result = mysql_query($Cus_orders_sql );
if( mysql_num_rows( $orders_result ) ) {
while ( $orders_row = mysql_fetch_assoc( $orders_result ) ) {

echo $orders_row['customer_account_number'];
}
..............................................................
As expected I get
1234567899

NOW after migration to MySQLi, following is the query

$orders_sql = "SELECT * FROM orders WHERE customer_id LIKE '$customer_id'";
$orders_result = mysqli_query($GLOBALS["__mysqliston"], $orders_sql );
if( mysqli_num_rows( $orders_result ) ) {
while ( $orders_row = mysqli_fetch_assoc( $orders_result ) ) {

echo $orders_row['customer_account_number'];
}


what I am getting OUTPUT is

2a
1234567899
0

I just want to know from where these artifacts viz. 2a and 0 appearing in output. No such thing is in my database. interestingly if output rows are more then each row is followed by mysterious numbers like 2a ,2b ,2c for integer columns and 54 ,55 for varchar columns

Can anybody explain the mystery
Thanks


Replace this line with your code.


#2

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.