Skip to content

PHP code snippet – How to pass variable in mysql laravel database?

$data = DB::select(DB::raw("SELECT pur_price FROM productpricing WHERE
                        mst_uid = (SELECT 
                            WHERE prd_id = :product_id
                                    AND mtl_id = :material
                                    AND color_id = :color
                                    AND mtl_status ='1')
                                     AND ($size between pur_sqft1 AND ifnull(pur_sqft2,$size))"),
                                    array('product_id'      =>$product_id,
                                             'material'     =>$material,
                                             'color'        =>$color,                                                 
See also  How to convert tuple into list in Python?

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.