Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

MindVerveMedia

Pioneers
  • Posts

    16
  • Joined

  • Last visited

Profile Information

  • Real Name
    Roxann Higuera

MindVerveMedia's Achievements

  1. Thank you for that. It seems to be working. It's literally been years since I put in that mod. I think the reason I did not have any trouble with it before is because the cache was empty.
  2. I tried to run my xsell admin module today, but my changes would not save. I got the following: Fatal error: Call to undefined function rdel() in /home/mindverv/public_html/admin/xsell.php on line 42 The only instance I can find in my source is the call to rdel(). It has something to do with the caching, from what I can tell. So what is it and where can I get it?
  3. I fixed the problem in tep_db_perform(). Here's what I did. It just needed a better check for NULL. function tep_db_perform($table, $data, $action = 'insert', $parameters = '', $link = 'db_link') { reset($data); if ($action == 'insert') { $query = 'insert into ' . $table . ' ('; while (list($columns, ) = each($data)) { $query .= $columns . ', '; } $query = substr($query, 0, -2) . ') values ('; reset($data); while (list(, $value) = each($data)) { // BOF: NULL check fix if (is_null($value)) { $query .= 'null, '; } else { // EOF: NULL check fix switch ((string)$value) { case 'now()': $query .= 'now(), '; break; case 'null': $query .= 'null, '; break; default: $query .= '\'' . tep_db_input($value) . '\', '; break; } // BOF: NULL check fix } // EOF: NULL check fix } $query = substr($query, 0, -2) . ')'; } elseif ($action == 'update') { $query = 'update ' . $table . ' set '; while (list($columns, $value) = each($data)) { switch ((string)$value) { case 'now()': $query .= $columns . ' = now(), '; break; case 'null': $query .= $columns .= ' = null, '; break; default: $query .= $columns . ' = \'' . tep_db_input($value) . '\', '; break; } } $query = substr($query, 0, -2) . ' where ' . $parameters; } return tep_db_query($query, $link); }
  4. The problem may be in tep_db_perform() itself. I added another debug statement before the call: function straight_move($ocID, $dest_ocID='') { // ------------------------------------------------------------------------------------------ $orders_move_id = ($dest_ocID == '') ? $ocID : $dest_ocID; // ------------------------------------------------------------------------------------------ // TABLE_HOLDING_ORDERS >> TABLE_ORDERS $ORDERS_move_query = tep_db_query("select * from " . TABLE_HOLDING_ORDERS . " where orders_id = '" . $ocID . "'"); $ORDERS_move = tep_db_fetch_array($ORDERS_move_query); $ORDERS_move['orders_id'] = $orders_move_id; echo "DEBUG: is_null(last_modified) " . is_null($ORDERS_move['last_modified']) . "<BR />"; echo "DEBUG: Before tep_db_perform(TABLE_ORDERS, \$ORDERS_move)<BR />"; tep_db_perform(TABLE_ORDERS, $ORDERS_move); echo "DEBUG: After tep_db_perform(TABLE_ORDERS, \$ORDERS_move)<BR />"; It returns true, so the value is properly set in $ORDERS_move['last_modified'].
  5. I'm getting the following error when I click "move" on the "OrderCheck -- Problem Orders" screen. 1292 - Incorrect datetime value: '' for column 'last_modified' at row 1 The problem occurs in admin\includes\functions\move_orders_check.php in these lines between the two debug echo statements: function straight_move($ocID, $dest_ocID='') { // ------------------------------------------------------------------------------------------ $orders_move_id = ($dest_ocID == '') ? $ocID : $dest_ocID; // ------------------------------------------------------------------------------------------ // TABLE_HOLDING_ORDERS >> TABLE_ORDERS $ORDERS_move_query = tep_db_query("select * from " . TABLE_HOLDING_ORDERS . " where orders_id = '" . $ocID . "'"); $ORDERS_move = tep_db_fetch_array($ORDERS_move_query); $ORDERS_move['orders_id'] = $orders_move_id; // BOF: debug echo "Before tep_db_perform(TABLE_ORDERS, \$ORDERS_move)\n"; // EOF: debug tep_db_perform(TABLE_ORDERS, $ORDERS_move); // BOF: debug echo "After tep_db_perform(TABLE_ORDERS, \$ORDERS_move)\n"; // EOF: debug Apparently, what is happening is that a NULL value for last_modified exists in the holding_orders table. How do I fix this statement so that the data will copy from one table to the other even if there is a NULL date, or NULL anything, for that matter? Is it something in the MySQL ini? This isn't the only place where I've had problems with NULL values or trying to use '' where NULL should be used.
×
×
  • Create New...