Hi,
I am upgrading a ZC 1.5.1 to ZC 1.5.4
The ZC 1.5.4 logs see some log like this
PHP Warning: mysql_query(): Access denied for user 'user'@'localhost' (using password: NO) in /home/user/public_html/zc/admin/shipping_export1.php on line 1194
PHP Warning: mysql_fetch_array() expects parameter 1 to be resource, boolean given in /home/user/public_html/zc/admin_xx/shipping_export1.php on line 1195
PHP Warning: mysql_query(): Access denied for user 'user'@'localhost' (using password: NO) in /home/user/public_html/zc/admin/shipping_export1.php on line 1198
PHP Warning: mysql_query(): A link to the server could not be established in /home/user/public_html/zc/admin/shipping_export1.php on line 1198
Yes, yes it is a Export Shipping+Order Information
but .... since some reason, I need change it to match my need, so above file named shipping_export1.php
While I google some inform know that from ZC 1.5.3 starting move from MySQL to MySQLi
And I also see the
Zen Cart’s database abstraction layer
https://www.zen-cart.com/wiki/index....ers_-_Database
But ... not too understand how to fix my self coding
Here are my coding that can work on ZC 1.5.1, but not the ZC 1.5.4
where the shipping_export1.php on line 1194 is below "$yu"
PHP Code:<?php
$payment_term=$module->title;
$payment_method=(strstr($module->code, 'paypal') ? 'PayPal' : $module->code);
$yu=mysql_query("SELECT * from required_definitions where payment_method = '".$payment_method."' ");
$req=mysql_fetch_array($yu);
if($req['payment_method'] != $payment_method)
{
mysql_query("INSERT into required_definitions (payment_method,class,class_name,definition) VALUES ('".$payment_method."','','','')");
}
?>
and after I am read the
Zen Cart’s database abstraction layer
https://www.zen-cart.com/wiki/index....ers_-_Database
I had try change the line 1194 to
then the logs not show error on line 1194 anymore, but ... I still see error on line 1195, 1198, no example for me as reference, I am lost of idea how to change it using $db->Execute way ..PHP Code:$yu=$db->Execute("SELECT * from required_definitions where payment_method = '".$payment_method."' ");
Any one can help me fix it? Thank you.



Reply With Quote

