Adding a Query

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • snjflame
    New Member
    • Feb 2010
    • 3

    Adding a Query

    Code:
    $query = $this->db->query("
        SELECT 
            op.product_id, 
            SUM(op.quantity) AS total 
        FROM " . DB_PREFIX . "order_product op 
        LEFT JOIN `" . DB_PREFIX . "order` o 
            ON (op.order_id = o.order_id) 
        WHERE o.order_status_id > '0' 
        GROUP BY op.product_id 
        ORDER BY total DESC 
        LIMIT " . (int)$limit);
    this code is from a php shopping cart, it's using to get the quantity of the added product,

    I want store the text in this "text field" while storing the quantity,
    Code:
    <input type="text" name="recip_name" size="45" value="xxxxxxxxxxx" />
    Structure: http://img638.imageshack.us/img638/6554/40402027.png
    Browse: http://img694.imageshack.us/img694/6773/81865398.png

    please help me to change the code ;(
    Last edited by Atli; Feb 5 '10, 07:26 PM. Reason: Added [code] tags and fixed the image links.
  • Atli
    Recognized Expert Expert
    • Nov 2006
    • 5062

    #2
    Hey.

    I don't really get what you are trying to do.

    Are you trying to display the results of the query you posted, or are you trying to update the database with the value of the input field?

    In any case, you are going to have to explain this a lot better if we are to be of any use to you.

    Comment

    Working...