SitePoint Sponsor

User Tag List

Results 1 to 2 of 2
  1. #1
    SitePoint Enthusiast
    Join Date
    Aug 2008
    Posts
    65
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    problem with creating/printing an array.pls hlp :(

    The following piece of code just won't seem to work for me! I know it works as far as
    PHP Code:
     $barc=extract_unit($bar$first$last); 
    And I know that the query works. The problem is that I want to create and print out an array of studentidresults, however the code I have written has a glitch in it somewhere and I just don't know why! Could really use some help, thanks loads in advance!

    Debz :)

    PHP Code:
          $first="";
            
    $last=",";
            
    $i=0;
            
    $studentidresult = array();
            foreach(
    $Barcodes as $bar)
            {
                
    $barc=extract_unit($bar$first$last);
              
    //  echo $barc.'<br>';
                
                
    $studentidresult[$i] = @mysql_query("SELECT Sid from mdl_students WHERE Cid LIKE '$barc' AND Cid NOT LIKE '' ");
                
    $x++;
            }
            
    foreach(
    $studentidresult as $s)
    {
    echo 
    $s;    


  2. #2
    SitePoint Enthusiast
    Join Date
    Aug 2008
    Posts
    65
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    solved it!!!


Bookmarks

Posting Permissions

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