Wierd problem, probably on server side

Discussion in 'PHP' started by redrum, Jun 24, 2006.

  1. #1
    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
     
    redrum, Jun 24, 2006 IP
  2. dtang4

    dtang4 Active Member

    Messages:
    303
    Likes Received:
    6
    Best Answers:
    0
    Trophy Points:
    58
    #2
    Have you tried something like this..

    $customers[] = array('id' => $customer_name, 'text' => $list['orders_id'], 'customers_name' => $list['customers_name']);
     
    dtang4, Jun 25, 2006 IP
  3. redrum

    redrum Peon

    Messages:
    18
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #3
    Thanks, but unfortunately this code doesn't list the customers name, only the order_id.
    You don't hapen to have another solution?
     
    redrum, Jul 1, 2006 IP
  4. kreoton

    kreoton Peon

    Messages:
    229
    Likes Received:
    7
    Best Answers:
    0
    Trophy Points:
    0
    #4
    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):
     
    kreoton, Jul 1, 2006 IP
  5. redrum

    redrum Peon

    Messages:
    18
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #5
    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.
     
    redrum, Jul 1, 2006 IP
  6. jimrthy

    jimrthy Guest

    Messages:
    283
    Likes Received:
    13
    Best Answers:
    0
    Trophy Points:
    0
    #6
    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:
     
    jimrthy, Jul 1, 2006 IP
  7. redrum

    redrum Peon

    Messages:
    18
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #7
    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
     
    redrum, Jul 2, 2006 IP