Web Analytics Made Easy -
StatCounter Would this work? - CodingForum

Announcement

Collapse
No announcement yet.

Would this work?

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • Would this work?

    Would this code actually work mainly the $_post['qty'.$var] can you add a var into it like that?


    while($update_checker_array = mysql_fetch_array($update_checker_query)){


    $update_cur_qty = $update_checker_array['item_qty'];
    $update_cur_id = $update_checker_array['id'];

    $field_value = $_POST['qty'.$update_cur_id];



    if($field_value != $update_cur_qty){

    $update_the_qty = mysql_query("UPDATE shopping_cart SET item_qty=$field_value WHERE id=$update_cur_id AND session_id='$session_id'");

    }


    }


    Any help :s
    Kong Dog Toys

  • #2
    Yes... you can add a variable like that, and this query should work. Why don't you try it and see if it works and then ask what went wrong when something screw's up? Saves time. ;-)
    PHP Code:
    while($update_checker_array mysql_fetch_array($update_checker_query)){
      
    $update_cur_qty $update_checker_array['item_qty'];
      
    $update_cur_id $update_checker_array['id'];
      
    $field_value $_POST['qty'.$update_cur_id];

      if(
    $field_value != $update_cur_qty){
        
    $update_the_qty mysql_query("UPDATE shopping_cart SET item_qty=$field_value WHERE id=$update_cur_id AND session_id='$session_id'");
      }

    Also please use the [php] tags... it helps with the eyes and sorting out the code.
    Last edited by dniwebdesign; Sep 28, 2006, 12:21 PM. Reason: Forgot [/php]
    Dawson Irvine
    CEO - DNI Web Design
    http://www.dniwebdesign.com

    Comment


    • #3
      OK thank you
      Kong Dog Toys

      Comment

      Working...
      X