Jump to content

bwouters

Members
  • Posts

    4
  • Joined

  • Last visited

Profile Information

  • Location
    Utrecht

bwouters's Achievements

Newbie

Newbie (1/7)

0

Reputation

  1. bwouters

    php array help

    The answer: $items = array(); foreach ($rows as $row) { $items[] = array("item" => $row["item"], "brand" => $row["brand"], "number" => $row["number"], "price" => $row["price"], "start" => $row["start"], "end" => $row["end"], "shop" => $row["shop"], "location" => $row["location"], "link" => $row["link"] ); }
  2. bwouters

    php array help

    Dear Ingolme, Thank you so much!!! I spent hours looking at it and now due to your help it is working. I am really really thankful with your help!! Bart
  3. bwouters

    php array help

    Thanks, however I am still receiving the same error msgs.
  4. bwouters

    php array help

    Dear reader, On my own server I created the following code that is working perfectly: $items = []; foreach ($rows as $row) { $items[] = [ "item" => $row["item"], "brand" => $row["brand"], "number" => $row["number"], "price" => $row["price"], "start" => $row["start"], "end" => $row["end"], "shop" => $row["shop"], "location" => $row["location"], "link" => $row["link"] ]; } However my hosting party is not supporting php 5.4 and therefor I transformed the code in: $items = array(); foreach ($rows as $row) { $items = array("item" => $row["item"], "brand" => $row["brand"], "number" => $row["number"], "price" => $row["price"], "start" => $row["start"], "end" => $row["end"], "shop" => $row["shop"], "location" => $row["location"], "link" => $row["link"] ); } and now I am getting the error msgs: "Uninitialized string offset: 0". Does anyone knows what I am doing wrong? Thanks inadvance for your help!!!
×
×
  • Create New...