Jump to content

panais

New Members
  • Posts

    2
  • Joined

  • Last visited

    Never

Everything posted by panais

  1. I can't use auto-increment to inv number field. I update that field when the transaction is completed succesfully. The record (order) is already created What about a trigger? Can a trigger solve my problem? Thanks for the quick responses
  2. Hello All, I Develop a small e-shop and i am facing a problem with invoice number I attach to an order the invoice number after client has successfully paid the order through Paypal, so i use the function below to retrieve the next inv num function GET_NEXT_INV_NUM() { $query= "SELECT MAX(inv_num) AS max_inv_num FROM orders"; $rs_query = mysql_query($query, $db) or die(mysql_error()); $row_query = mysql_fetch_assoc($rs_ws_mod_tvg_program_rec); $Next_inv_num = $row_query['max_inv_num']+1; return $Next_inv_num; } all looked to work fine but one day i realised that i have some invoice numbers that are missing, because in some cases instead of next inv to increase by one, is increased by two for example: INV NUMBERS: ============ 101 102 103 --->PROBLEM HERE (MISSING 104) 105 106 107 108 109 110 --->PROBLEM HERE (MISSING 111) 112 113 114 115 116 ... I check all of my code 3-4 times and all looks ok Can anyone help me please??? Thanks in advance (i apologise for my english)
×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.