Magento deleting product BIGINT UNSIGNED value is out of range

Several of our clients get an unusual recurring error in their Magento stores looking like:

SQLSTATE[22003]: Numeric value out of range: 1690 BIGINT UNSIGNED value is out of range in '(`magento_store`.`q`.`items_count` - 1)'

Option 1

DELETE FROM magento_sales_flat_quote WHERE updated_at < DATE_SUB(Now(),INTERVAL 30 DAY);

Option 2

DELETE FROM magento_sales_flat_quote WHERE customer_is_guest = 0;

Option 3

SET FOREIGN_KEY_CHECKS=0;
#truncate magento_enterprise_customer_sales_flat_quote;
#truncate magento_enterprise_customer_sales_flat_quote_address;
truncate magento_sales_flat_quote;
truncate magento_sales_flat_quote_item;
truncate magento_sales_flat_quote_address;
truncate magento_sales_flat_quote_shipping_rate;
SET FOREIGN_KEY_CHECKS=1;



http://www.pkdavies.co.uk/162-magento-deleting-product-bigint-unsigned-value-is-out-of-range.html
Advertisements

Github Basic – part 1

http://gitref.org/
http://git-scm.com/book/
http://git-scm.com/docs/
https://www.kernel.org/pub/software/scm/git/docs/everyday.html

git push –set-upstream origin master –force
This will upload your local repo to the server no matter what, overwriting if necessary. This should only be done if you’re sure nobody else is publishing to your repo at the moment.

your initial repository must already be published for following steps

. navigate to your project directory in git shell
. git init
. git add *
. git commit -m ‘version-name: Your description’
. git push origin master:refs/heads/master
By force pushing git push –set-upstream origin master –force

help commands on ms-dos

xcopy * c:\xampp\htdocs\p\i1 /E
xcopy source [destination-path] /E
/E is optional
/E means Copies directories and subdirectories, including empty ones.

Magento Developer Knowledge Links

Magento for Developers
http://www.magentocommerce.com/knowledge-base/entry/magento-for-dev-part-1-introduction-to-magento

Magento API
http://www.magentocommerce.com/api/soap/introduction.html

Magento Documentation (phpdoc) Varien Lib Documentation
http://docs.magentocommerce.com/

Others
https://www.yireo.com/tutorials/magento/magento-programming/629-connecting-to-magento-with-soap-part-1
http://stackoverflow.com/questions/8569275/magento-retrieve-highest-product-price-in-current-collection-from-layered-nav

http://www.webdosh.net/2011/04/magento-get-skin-url-get-media-url-get.html

Codeigniter + Joomla Integration Success

developer-joomla
http://developer.joomla.org/

Joomla 2.5.7 – API
http://doc.joomladev.eu/api25/

Joomla Framework
http://www.phoca.cz/joomla/api/class-JFactory.html

API15
http://docs.joomla.org/API15:JFactory_Class

public function listAll(){

JDEBUG ? $_PROFILER->mark(‘afterLoad’) : null;
JLoader::discover(”,’./system/core/’,true,true);
$app = JLoader::getClassList();
foreach($app as $class=>$path){
echo $class.’ => ‘.$path.’
‘;
}
}

Mysql timestamp query methods

SELECT *
FROM `page`
WHERE DAY( `date_created` ) = 19
AND MONTH( `date_created` ) = 06
AND YEAR( `date_created` ) = 2014
AND HOUR( `date_created` ) = 13
LIMIT 0 , 30

Other filter which you can use are
ADDDATE() Add time values (intervals) to a date value
ADDTIME() Add time
CONVERT_TZ() Convert from one timezone to another
CURDATE() Return the current date
CURRENT_DATE(), CURRENT_DATE Synonyms for CURDATE()
CURRENT_TIME(), CURRENT_TIME Synonyms for CURTIME()
CURRENT_TIMESTAMP(), CURRENT_TIMESTAMP Synonyms for NOW()
CURTIME() Return the current time
DATE_ADD() Add time values (intervals) to a date value
DATE_FORMAT() Format date as specified
DATE_SUB() Subtract a time value (interval) from a date
DATE() Extract the date part of a date or datetime expression
DATEDIFF() Subtract two dates
DAY() Synonym for DAYOFMONTH()
DAYNAME() Return the name of the weekday
DAYOFMONTH() Return the day of the month (0-31)
DAYOFWEEK() Return the weekday index of the argument
DAYOFYEAR() Return the day of the year (1-366)
EXTRACT() Extract part of a date
FROM_DAYS() Convert a day number to a date
FROM_UNIXTIME() Format UNIX timestamp as a date
GET_FORMAT() Return a date format string
HOUR() Extract the hour
LAST_DAY Return the last day of the month for the argument
LOCALTIME(), LOCALTIME Synonym for NOW()
LOCALTIMESTAMP, LOCALTIMESTAMP() Synonym for NOW()
MAKEDATE() Create a date from the year and day of year
MAKETIME() Create time from hour, minute, second
MICROSECOND() Return the microseconds from argument
MINUTE() Return the minute from the argument
MONTH() Return the month from the date passed
MONTHNAME() Return the name of the month
NOW() Return the current date and time
PERIOD_ADD() Add a period to a year-month
PERIOD_DIFF() Return the number of months between periods
QUARTER() Return the quarter from a date argument
SEC_TO_TIME() Converts seconds to ‘HH:MM:SS’ format
SECOND() Return the second (0-59)
STR_TO_DATE() Convert a string to a date
SUBDATE() Synonym for DATE_SUB() when invoked with three arguments
SUBTIME() Subtract times
SYSDATE() Return the time at which the function executes
TIME_FORMAT() Format as time
TIME_TO_SEC() Return the argument converted to seconds
TIME() Extract the time portion of the expression passed
TIMEDIFF() Subtract time
TIMESTAMP() With a single argument, this function returns the date or datetime expression; with two arguments, the sum of the arguments
TIMESTAMPADD() Add an interval to a datetime expression
TIMESTAMPDIFF() Subtract an interval from a datetime expression
TO_DAYS() Return the date argument converted to days
UNIX_TIMESTAMP() Return a UNIX timestamp
UTC_DATE() Return the current UTC date
UTC_TIME() Return the current UTC time
UTC_TIMESTAMP() Return the current UTC date and time
WEEK() Return the week number
WEEKDAY() Return the weekday index
WEEKOFYEAR() Return the calendar week of the date (0-53)
YEAR() Return the year
YEARWEEK() Return the year and week