473,467 Members | 1,603 Online
Bytes | Software Development & Data Engineering Community
Create Post

Home Posts Topics Members FAQ

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($sql4, $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($sql2, $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,"Lab Number: ".$labnumber,'LR',0,'L',1);
$this->Cell(100,6,"Lab Name: ".$labname,'LR',0,'L',1);
$this->Cell(75,6,"Hours lost due to: ",'LR',0,'L',1);
$this->Ln();
$this->SetFillColor(255,0,0);
$this->SetTextColor(255);
// ################################################## ##########
// ######## 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);
}

Jul 17 '05 #1
0 1149

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

5
by: qwweeeit | last post by:
Hi all, I need to limit as much as possible the lenght of a source line, stripping white spaces (except indentation). For example: .. . max_move and AC_RowStack.acceptsCards ( self,...
12
by: Treetop | last post by:
I cannot get this array to work. I want to have the game listed until the day after the event, then come off the list. function events() { var today = new Date(); var dayarray=new...
4
by: J | last post by:
anybody know a vb.net command to populate an array with each word in a string? for example " hi how are you" array(0) = hi array(1) = how array(2) = are array(3) = you i know i could...
4
by: Andreas Prilop | last post by:
How many spaces should be displayed in A <span style="display:none">x</span> B between "A" and "B"? I notice that Mozilla displays one space and Internet Explorer (5 & 6) displays two spaces....
1
by: Brian Mitchell | last post by:
I'm sorry if this is the wrong group but I couldn't find one relating to cryptography. I have a byte array that I am encrypting using the System.Cryptography classes and it encrypts just...
22
by: Brent | last post by:
I want to paste a lengthly text document into a web page and have it retain all of whitespace and line breaks. I first tried the <pretag but that didn't work because it doesn't wrap the text. I...
0
by: nt91rx78 | last post by:
Our college changes 18 weeks semester to 16 semester, so our CS professor cannot finish teaching the last important chapter which is related with my problw\em. This is program C problem Anyone...
0
by: gunimpi | last post by:
http://www.vbforums.com/showthread.php?p=2745431#post2745431 ******************************************************** VB6 OR VBA & Webbrowser DOM Tiny $50 Mini Project Programmer help wanted...
1
by: biznitchil | last post by:
it is a bit jacked up, but copy and paste it into an IDE(i use jGRASP) plz help me...it worked just fine before I added the menu..you can e-mail me if you have any <Removed> import java.util.*; ...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...
0
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The...
0
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
0
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated ...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.