Moving WP Database to another hosting server
After moving WP website to another server, you’ll try to login to Admin Control Panel, you might see this error “You do not have sufficient permissions to access this page.” This is how to fix it: UPDATE `{%TABLE_PREFIX%}usermeta` SET `meta_key` = replace(`meta_key`, ‘{%OLD_TABLE_PREFIX%}’,'{%NEW_TABLE_PREFIX%}’); UPDATE `{%TABLE_PREFIX%}options` SET `option_name` = replace(`option_name`, ‘{%OLD_TABLE_PREFIX%}’, ‘{%NEW_TABLE_PREFIX%}’);
Using glob() function in PHP
To find pathnames matching a pattern such as .html or .php, you’ll use this glob() function. The return value is an array of files that has the matched pattern that you defined. Function: array glob ( string $pattern [, int $flags = 0 ] ) Usage: foreach (glob(“*.htm”) as $filename) { echo “$filename size ” . filesize($filename) . “\n”; } You can use this function to manage file system on your server. Example: Using array_map function to perform a callback to the elements of a…
How to develop a new set of all button images in another language
In Zencart, if you want to change the design of the button images, you’ll find them in the directory: includes\templates\template_default\buttons\english\. If you purchase or download a free zencart template on the internet, you will find them in the directory of your purchased template. Unlike other system, these images are not located under “images” directory. The reason for this setup is that it’s easier for multiple languages can be developed in the future. For example, if you want to add a set of button images in…
Problems with Paypal Express in zen cart
We’ve got a few phone calls lately about the issue with PayPal Express. The issue is that when customer clicks on Paypal Express button, it display many lines of warning instead of taking them directly to Paypal page. The errors: Warning: array_merge() [function.array-merge]: Argument #1 is not an array in /home2/crowscom/public_html/includes/modules/payment/paypalwpp.php on line 1467 Warning: array_merge() [function.array-merge]: Argument #2 is not an array in /home2/crowscom/public_html/includes/modules/payment/paypalwpp.php on line 1467 Warning: Cannot modify header information – headers already sent by (output started at /home2/crowscom/public_html/includes/modules/payment/paypalwpp.php:1467) in /home2/crowscom/public_html/includes/modules/payment/paypalwpp.php on…
How to insert an image to MySql database with php
A BLOB is a binary large object that can hold a variable amount of data. There’re 4 datatypes that you can select for a blob field, depending how much storage of an image you’ll need. TINYBLOB A binary large object column with a maximum length of 255 (2^8 – 1) characters. BLOB A binary large object column with a maximum length of 65535 (2^16 – 1) characters. MEDIUMBLOB A binary large object column with a maximum length of 16777215 (2^24 – 1) characters. LONGBLOB A…