Y
Y
yv19952016-10-31 11:34:03
Magento
yv1995, 2016-10-31 11:34:03

How does working with PDO work in Magento?

Are there any sources about working with PDO in Magento? Thank you!

Answer the question

In order to leave comments, you need to log in

1 answer(s)
Y
Yuri Gerasimenko, 2016-10-31
@yv1995

It?

$write = Mage::getSingleton("core/resource")->getConnection("core_write");

// Concatenated with . for readability
$query = "insert into mage_example "
       . "(name, email, company, description, status, date) values "
       . "(:name, :email, :company, :desc, 0, NOW())";

$binds = array(
    'name'    => "name' or 1=1",
    'email'   => "email",
    'company' => "company",
    'desc'    => "desc",
);
$write->query($query, $binds);

Source: stackoverflow.com/questions/3575160/using-magento-...

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question