Skip to content Skip to sidebar Skip to footer

Php: Sql Value As Filename

I have this code:

Solution 1:

You can make your life easier by naming the value like this:

$sql = "SELECT o.order_id as filename, o.customer_id, op.quantity, op.model FROM oc_order o INNER JOIN oc_order_product op ON o.order_id = op.order_id INNER JOIN oc_product p ON op.product_id = p.product_id WHERE o.order_status_id = 2 AND p.location = 1 ORDER BY o.order_id, op.model";

then when you handle the rows you can use

$rows['filename']

Post a Comment for "Php: Sql Value As Filename"