Author: james

PHP MYSQL code for SELECT, UPDATE, LOADRESULT and LOADOBJECT examples

PHP mysql_connect for UPDATE example mysql_select_db(“database”, $con); $result = mysql_query(“ALTER TABLE jos_acajoom_subscribers ADD interested_in varchar(200); “); if (!$result) { die(‘Invalid query: ‘ . mysql_error()); } mysql_close($con) Joomla MYSQL loadResult example global $database;  $sql = ‘SELECT title FROM #__categories’; $database->setQuery( $sql

read more

Illegal characters in MYSQLdump solution:

Illegal characters in MYSQLdump solution: use php or command line to export mysql database as latin1 : <?php exec(“mysqldump –default-character-set=latin1 -uUSERNAME -pPASSWORD DATABASE > DATABASE.sql”); ?> open in editor and Find/Replace latin1 to utf8 then import using web interface or

read more

Magento – display product attributes in category list page

Magento – display product attributes in category list page Say you’ve added ‘brand’ as an attribute and added it to the Default attribute set (make sure the attribute is visible in the frontend). Then add this: From http://www.magentocommerce.com/boards/viewthread/19215/ <?phpecho $this->htmlEscape($_product->getData(‘brand’));  

read more

Magento admin page xxx.com/index.php/admin gives 404 error.

Magento admin page xxx.com/index.php/admin gives 404 error. SET FOREIGN_KEY_CHECKS=0; UPDATE `core_store` SET store_id = 0 WHERE code=’admin’; UPDATE `core_store_group` SET group_id = 0 WHERE name=’Default’; UPDATE `core_website` SET website_id = 0 WHERE code=’admin’; UPDATE `customer_group` SET customer_group_id = 0 WHERE

read more

Joomla countModules function example

Joomla countModules function <?php if ($this->countModules( ‘user1’ )) : ?> <div id=”image_division”><jdoc:include type=”modules” name=”slider_image” style=”xhtml” /> </div> <?php endif; ?>