Jump to content

jonathanbee

Members
  • Posts

    28
  • Joined

  • Last visited

    Never

Everything posted by jonathanbee

  1. I've been trying to get this working forever and searching though these forums.. please help. I am using now(), but I'd like to use strftime("%d. %B %Y %R"). I can't for the life of me figure out how to use strftime("%d. %B %Y %R") in the code below without it failing. The other issue is that both now() and strftime("%d. %B %Y %R") return 9/27 as the date. But it's 9/28. How can get it to return the correct date? I thought the setlocale would address this. <?php @setlocale(LC_TIME, 'ja_JP.EUC-JP'); mb_language('Japanese'); mb_internal_encoding("EUC-JP"); mb_http_output("EUC-JP"); $query = "Insert into res (name,gender,age,country,other_country,first_time,email,f1n,f1e,f2n,f2e,comments,t_stamp) values ('$_POST[name]','$_POST[gender]','$_POST[age]','$_POST[country]','$_POST[other_country]','$_POST[first_time]','$_POST','$_POST[f1n]','$_POST[f1e]','$_POST[f2n]','$_POST[f2e]','$_POST[comments]',now())"; $result = mysql_query($query) or die("Insert failed"); ?>
  2. Thanks!!! I used your code, but just changed: $order->saveOrder($db ,'newfield'); to $order->saveOrder($db , $newfield); works great! Thanks again.
  3. I've added a 4th field to my TABLE_ORDER, but I can't figure out how to insert data into this new field.. The variable is called mailingList. Advice very appreciated! -------------------- in confirm.php: -------------------- //database stuff $order = new order($email); $orderNumber = $order->saveOrder($db); //end database stuff -------------------- in order.class.php: -------------------- <?php class order { var $email; function order($email) { $this->email = $email; } function saveOrder($db) { $query = "INSERT into `" . TABLE_ORDER . "`(`o_id`, `date`, `email`) VALUES('', now(), '" . $this->email . "')"; $db->execute($query); return $this->getMaxOrderNumber($db); } function getMaxOrderNumber($db) { $result = $db->execute("SELECT MAX(`o_id`) FROM `" . TABLE_ORDER . "`"); return $result->fields['MAX(`o_id`)']; } } ?>
×
×
  • 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.