dcsimg
www.webdeveloper.com
Results 1 to 2 of 2

Thread: Array problem

  1. #1
    Join Date
    Jun 2013
    Posts
    1

    Post Array problem

    using this query:

    $queryC = "SELECT * FROM tbl_courses WHERE course_id='$course_id'";
    $resC = mysql_fetch_assoc(dbQuery($queryC));
    $allUnits = $resC[course_unit];
    print_r(array($allUnits));

    returns:
    Array ( [0] => 3 ) Array ( [0] => 3 ) Array ( [0] => 2 ) Array ( [0] => 2 )

    but am expecting it to return

    Array ( [0] => 3 ) Array ( [1] => 3 ) Array ( [2] => 2 ) Array ( [3] => 2 )


    anybody whit usefull help please....


    I need it as soon as possible

    Thanks in advance

  2. #2
    Join Date
    May 2013
    Location
    London, UK
    Posts
    16
    Probably because you are print_r() the result within a new array. Try changing it to:

    print_r ($allUnits);

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
HTML5 Development Center



Recent Articles