Hi, Good morning,
I am tryingto apply a conditional action on my drupal, page. by applying this conditional action with the following custom php to add an entry to the database, but unfortunately, no entry is being submitted. and there is no returning error too. can you please assist?
here is the custom php I have added.
$result = db_query_range('SELECT*FROM users AS u LEFT JOIN profile_values AS pv ON u.uid = pv.uid WHERE u.uid = %d', $order->uid, 0, 10);
while ($res = db_fetch_object($result)) { $data = array( 'id' => '', 'reqadm_login' => $res->name, 'reqadm_pass' => $res->pass, 'domain_name' => $res->value, 'family_name' => $order->billing_first_name, 'first_name' => $order->billing_last_name, 'comp_name' => $order->billing_company, 'iscomp' => 'yes', 'email' => $order->primary_email, 'phone' => $order->billing_phone, 'addr1' => $order->billing_street1, 'addr2' => $order->billing_street2, 'zipcode' => $order->billing_postal_code, 'city' => $order->billing_city, 'country' => $order->billing_country, 'paiement_id' => $order->order_id, 'product_id' => $order->, 'shopper_ip' => $order->host, 'date' => $nowdate, 'time' => $nowtime, 'add_service' => 'yes' ); drupal_write_record('new_admin', $data);
I think you need a *_schema() definition to use drupal_write_record I'd try db_insert("new_admin")->...
Bye
Il 29/02/2012 10:39, Kokou Afidegnon ha scritto:
Hi, Good morning,
I am tryingto apply a conditional action on my drupal, page. by applying this conditional action with the following custom php to add an entry to the database, but unfortunately, no entry is being submitted. and there is no returning error too. can you please assist?
here is the custom php I have added.
$result = db_query_range('SELECT*FROM users AS u LEFT JOIN profile_values AS pv ON u.uid = pv.uid WHERE u.uid = %d', $order->uid, 0, 10); while ($res = db_fetch_object($result)) { $data = array( 'id' => '', 'reqadm_login' => $res->name, 'reqadm_pass' => $res->pass, 'domain_name' => $res->value, 'family_name' => $order->billing_first_name, 'first_name' => $order->billing_last_name, 'comp_name' => $order->billing_company, 'iscomp' => 'yes', 'email' => $order->primary_email, 'phone' => $order->billing_phone, 'addr1' => $order->billing_street1, 'addr2' => $order->billing_street2, 'zipcode' => $order->billing_postal_code, 'city' => $order->billing_city, 'country' => $order->billing_country, 'paiement_id' => $order->order_id, 'product_id' => $order->, 'shopper_ip' => $order->host, 'date' => $nowdate, 'time' => $nowtime, 'add_service' => 'yes' ); drupal_write_record('new_admin', $data);