shopping cart class

refrence http://codereview.stackexchange.com/questions/25671/my-perfect-shopping-cart-class Easy way is copy this code to your php editor. 1、const ID, QTY for column name, it’s can change by yourself. 2、session only check isset. 3、array_push_after() maybe use not good way. 4、$item from CartItemtoArray(), this is array(). not class object. 5、getIndexOfEntry() try to get Array $container at index. So use Array to control, no Object. Becasue I don’t know refrence, answer 1 and 2, How to create item add in cart. ID is key. Answer 1 can run, answer 2 is broken. ...

2016-03-23 · 3 min · 430 words · Me

PDO array Undefined offset Undefined index fetchAll(PDO::FETCH_ASSOC) fetch(PDO::FETCH_ASSOC)

When you use PDO, try to get fetchAll(PDO::FETCH_ASSOC) fetch(PDO::FETCH_ASSOC) return is Array. This Array have rows, it’s mean : array[0] = array[“field1”, “field2”, “field3”] array[1] = array[“field1”, “field2”, “field3”] …… array[10] = array[“field1”, “field2”, “field3”] So get array index or row maybe not exist, when you try to get value, get error code. You can try to make two function: function ar_get($val, $ar){ return array_key_exists($val, $ar)?$ar[$val]:""; } function crud_ar_get($val, $ar, $rec_arrow=0){ return (isset($ar[$rec_arrow]))?ar_get($val, $ar[$rec_arrow]) : “”; } ...

2016-03-18 · 1 min · 151 words · Me

[轉]在windows环境下让XAMPP使用Nginx作为Web服务器

http://avnpc.com/pages/add-nginx-to-xampp

2016-03-09 · 1 min · word · Me

[轉]PDO学习笔记

http://www.ido321.com/1424.html PDO支持三种异常模式: 默认模式:PDO::ERRMODE_CLIENT 警告模式:PDO::ERRMODE_WARNING 异常模式:PDO::ERRMODE_EXCEPTION(推荐)

2016-03-04 · 1 min · 5 words · Me

[轉]【译】PHP:40+开发工具推荐

http://www.ido321.com/1546.html ===== good http://phpdebugbar.com/

2016-03-04 · 1 min · 4 words · Me