1

Here is the query in controller to save an uploaded file path from a custom directory to database custom table but it is not including the actual page query removed the slashes and the add plain string in to database table

$connectionresource = Mage::getSingleton('core/resource');
        $connectionWrite = $connectionresource->getConnection('core_write');
        $prefix = Mage::getConfig()->getTablePrefix();
        $table = 'magesf_ordercustom';
        $query = "insert into ".$prefix.$table." "
             . "(order_id,image_url,image_comments,customer_id) values "
             . "('$orderid', '$paths', '$attach_comments','$order_cus_id')";

        $binds = array(
          'order_id'    => $orderid,
          'image_url'   => $paths,
          'image_comments' => $attach_comments,
          'customer_id' => $order_cus_id,

        );

        $connectionWrite->query($query, $binds);

Actual path should be like this:

c:/xampp/htdocs/magento_dev/media/customer_documents/error.png

But it is saving as:

C:xampphtdocsmagento_devmediacustomer_documentserror.png

What is the issue with query is there any default behaviour of Magento?

Please guide.

0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Browse other questions tagged or ask your own question.