Help array is slicing up my sting from a DB at the white spaces between the word

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • t0642k8

    #1

    Help array is slicing up my sting from a DB at the white spaces between the word

    Help ,
    the script is executing nice , until it come to the section below.
    The data out of the Database is a full string with whitespaces in
    between each word. For example it the variable is "the quick brown fox"
    the data retrieved from the array would be "the"



    //############### ############### ############### ##
    // Query DB for distinct Lab name
    // ############### ############### ############### ###
    $count313 = 0;
    $sql4 = "SELECT Distinct Event_title FROM `tevents`";
    $result1 = mysql_query($sq l4, $db);
    while ($rows1 = mysql_fetch_row ($result1)) {
    $lab1 = $rows1[0];
    fputs($handle, " lab1 from db ".$lab1."\n ");

    // add array stuff
    $dlab[$count313] = $lab1;

    $count313++;
    }
    //*************** *************** *************** *************** **********

    // just to check whats in array
    for($index1 = 0; $index1 < count($dlab); $index1++) {
    $dlab1 = $dlab[$index1];






    // ############### ############### ##############
    // ###### query array #########
    // ############### ############### ##############
    for($index = 0; $index < count($d_lab); $index++) {
    $cdp1 = $d_lab[$index] [0];
    $labname = $d_lab[$index] [1];
    $off_start = $d_lab[$index] [2];
    $off_end = $d_lab[$index] [3];
    $en_start = $d_lab[$index] [4];
    $en_end = $d_lab[$index] [5];

    $cin = $d_lab[$index] [6];
    $uic = $d_lab[$index] [7];
    $event_details = $d_lab[$index] [8];
    $inst_hours = $d_lab[$index] [9];
    $cin = $d_lab[$index] [10];

    fputs($handle, " Whats gponf \n\n ");
    fputs($handle, " dlab =\t".$dlab1." labname = ".$labname."\n" );

    if($labnumber != $lab1){ // this is to put label on
    // problem here

    // get lab number
    $sql2 = "SELECT * FROM labs where labname = '".$labname."'" ;
    $result = mysql_query($sq l2, $db);
    $rows = mysql_fetch_row ($result);
    $labnumber = $rows[2];

    fputs($handle, "\t labnumber = ".$labname. "\t lab1 =
    ".$lab1."\n ");

    fputs($handle, "\t not match\n");
    $this->Cell(85,6,"L ab Number: ".$labnumber,'L R',0,'L',1);
    $this->Cell(100,6,"La b Name: ".$labname,'LR' ,0,'L',1);
    $this->Cell(75,6,"Hou rs lost due to: ",'LR',0,'L',1) ;
    $this->Ln();
    $this->SetFillColor(2 55,0,0);
    $this->SetTextColor(2 55);


    // ############### ############### ############### ###############
    // ######## decession .. does this match distinct ?? #######
    // ############### ############### ############### ###############
    fputs($handle, " ########## \n");
    fputs($handle, " Does labname match dlab\n");

    if($labname == $dlab1) {


    fputs($handle, " Match\n");



    foreach($col as $label=>$width)
    {
    $tw+=$width;
    $this->Cell($width,7, $label,1,0,'C', 1);
    }

Working...