The mysql extension is deprecated and will be removed in the future: use mysqli or pdo instead


$connection = Mage::getSingleton("core/resource")->getConnection("core_read");$sql = "Select * from catalog_product_flat_1";$rows = $connection->fetchAll($sql); //fetchRow($sql), fetchOne($sql),...Zend_Debug::dump($rows);For core_write use below code

$resource = Mage::getSingleton("core/resource");$writeConnection = $resource->getConnection("core_write");$table = $resource->getTableName("catalog/product");$query = "UPDATE $table SET item = "value" WHERE entity_id = "value"";$writeConnection->query($query);`

Bạn đang xem: The mysql extension is deprecated and will be removed in the future: use mysqli or pdo instead


Don"t use mysql, mysqli or even PDO in Magenlớn code.

If this is the lớn database, use the existing connection from

$connection = Mage::getSingleton("core/resource")->getConnection("core_read");See also:

If it is a different database, you still can use the Magenlớn methods, but need khổng lồ define an additional connection as explained here: how lớn connect another database from


Xem thêm: Đăng Ký Hosting Miễn Phí Tốt Nhất Hiện Nay, Đã Test, 16 Web Hosting Miễn Phí (2021) Để Xem Xét

Thanks for contributing an answer khổng lồ Staông chồng Exchange!

Please be sure to answer the question. Provide details and giới thiệu your research!

But avoid

Asking for help, clarification, or responding to lớn other answers.Making statements based on opinion; baông xã them up with references or personal experience.

To learn more, see our tips on writing great answers.

Post Your Answer Discard

By clicking “Post Your Answer”, you agree khổng lồ our terms of service, privacy policy & cookie policy

Not the answer you're looking for? Browse other questions tagged database sql or ask your own question.

Magenlớn PHP Deprecated: preg_replace(): The /e modifier is deprecated, use preg_replace_callback instead

site design / logo © 2021 Stachồng Exchange Inc; user contributions licensed under cc by-sa. rev2021.7.30.39889

Your privacy

By clicking “Accept all cookies”, you agree Stack Exchange can store cookies on your device & discthua information in accordance with our Cookie Policy.

Chuyên mục: Domain Hosting