I have a wierd problem, that occurs sometimes. I use OSCommerce and when I want to create a droplist with all my customers orders whitin I can only use one value from the orders table. For example only the customers name or the order id. I can't use both customers name and orders id in the droplist. If I try that I just get a blank page below where that code is starting. This is what I try to use and doesnt work: $customers[] = array('id' => $customer_name, 'text' => $list['orders_id'] . ', '. $list['customers_name']); Code (markup): But this code work: $customers[] = array('id' => $customer_name, 'text' => $list['orders_id']); Code (markup): I have the exactley same problem in the original file admin/mail.php. Its just a blank page. If I strip that section in mail.php so it looks like this: 'text' => $customers_values['customers_lastname']); Code (markup): Then all the form fields and submit button will be displayed. Since I don't use mail.php that often I don't know how often this problem occurs, but a month ago or so I had the same problem. I then mailed my host and then everytinhng started to working again. One day later I received a responce from my host telling that they havent done anything. Can anyone help me out whit this? Thanks, Fredrik
Have you tried something like this.. $customers[] = array('id' => $customer_name, 'text' => $list['orders_id'], 'customers_name' => $list['customers_name']);
Thanks, but unfortunately this code doesn't list the customers name, only the order_id. You don't hapen to have another solution?
Don't join elements while formating an array, do it before: $var = $list['orders_id'] . ", ". $list['customers_name']; $customers[] = array('id' => $customer_name, 'text' => $var ); Code (markup):
This code also gives me a blank page. If I remaove $list['customers_name']; so it looks like this $var = $list['orders_id']; $customers[] = array('id' => $customer_name, 'text' => $var ); Code (markup): Then the droplist shows, but of course with only the order_id.
Just to clarify. You said you could use just the customer's name as well as the order number. So this works fine? $var = $list['customers_name']; $customers[] = array('id' => $customer_name, 'text' => $var ); PHP: How does this work? $visible_text = $list['orders_id'] . ", ". $customer_name; // $var is a bad name $customers[] = array('id' => $customer_name, 'text' => $visible_text); PHP:
Hey, this works . Thanks alot. And I thank you all so much for taking time to look into this. This forum seems to be a great palce. Thanks, Fredrik