Category Archives: PHP

SQLSTATE[HY093]: Invalid parameter number: no parameters were bound

Một lỗi củ chuối vừa bị dính ngày hôm qua. Chuỗi sql: ?View Code PHP1 2 3 $value = $this->_db->quote($value); // output like ‘ test? \’ special characters’ $query = "UPDATE table_abc SET field_def = $value WHERE field_xyz = 123"; … Continue reading

Posted in PHP | Leave a comment

Install (downgrade) php 5.2.x in Ubuntu 10.04 Lucid

Today, all computers in my PHP department has been changed to Ubuntu 10.04. That’s awesome ^^ But my current project is running on out of date PHP & Zend Framework versions that was deprecated from PHP 5.3.0 Our Windows server … Continue reading

Posted in PHP, Trick, Ubuntu | Tagged , | Leave a comment

Create short IDs with PHP – Like Youtube or TinyURL

IDs are often numbers. Unfortunately there are only 10 digits to work with, so if you have a lot of records, IDs tend to get very lengthy. For computers that’s OK. ButOther title options where How to create unique short … Continue reading

Posted in PHP, Trick | Leave a comment

PHP Fatal error

Trong 1 dự án gặp đến 2 lỗi có thể nói là nghiêm trọng ( Cannot use object of type __PHP_Incomplete_Class as array 406 Not Acceptable Lỗi thứ nhất “thường” xảy ra ở khu vực tương tự như sau: ?View … Continue reading

Posted in PHP | Leave a comment

is_dir vs file_exists

Hôm nay ở cty anh Linh đã hỏi có ai biết hàm kiểm tra thư mục đã tồn tại hay chưa không? (anh ấy đang làm cái liên quan đến theme thì phải ). Theo phản xạ tôi bật ngay … Continue reading

Posted in PHP | Leave a comment