Привет у меня возникли проблемы при попытке сохранить в нескольких строках в таблице «уведомления» с идентификаторами таблицы для клиентов, но это спасло меня только одну строку, это мой код:
$customers = tep_get_customers();
$count = 0;
for ($i=0, $n=sizeof($customers); $i<$n; $i++) {
$count ++;
$insert_str_cony .= $customers[$i]['id'];
$split_customers_id = explode("||", $insert_str_cony.'||', -1);
$values .= "('','" . tep_db_input('1') . "', now(), '" . tep_db_input($products_id) . "', '" . tep_db_input($split_customers_id[$count]) . "'),";
$db_values = substr_replace($values, '', -1, 1);
}
if ($action == 'insert_product') {
tep_db_query("insert into notifications (notify_id, prod_notify, notify_added, prod_id, customers_id) values ". $db_values);
} elseif ($action == 'update_product') {
tep_db_query("update notifications set prod_notify = '" . tep_db_input('1mod') . "', notify_last_mod = now(), prod_id = '" . $HTTP_GET_VARS['pID'] . "', customers_id = '" . tep_db_input($customers['customers_id']) . "'");
}
и этоэто функция tep_get_customers ();
function tep_get_customers() {
$customers_query = tep_db_query("select distinct customers_id from " . TABLE_CUSTOMERS . "");
while ($customers = tep_db_fetch_array($customers_query)) {
$customers_array[] = array('id' => '||'.$customers['customers_id']);
}
return $customers_array;
}
нужна помощь !!!спасибо!