[PHP-DB] the space in php

2002-07-21 Thread bo

To Php Gurus:

I'm writing some code  like this:
 echo(tda
href=javascript:popUp('bios/bio_.$row[scoutname]..html').$row[scoutbi
o]./a/td);

but the scoutname is something like Mike Johnson, which has a space in
bettwen Mike and Johnson, how do I chop this space off, so I can name the
corresponding html file as bio_MikeJohnson ?
Thanks and any feedback will be appreciated!

Good Day.

Bo



-- 
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php




[PHP-DB] the space in php (2)

2002-07-21 Thread bo

Indeed, it's better that if I can just stop when I encouter a space before
Johnson, and take the first name(Mike) off. So, the file name will be
bio_Mike.html


Thanks
Bo



-- 
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php




[PHP-DB] Re: the space in php

2002-07-21 Thread bo

test
Bo [EMAIL PROTECTED] дÈëÏûÏ¢ÐÂÎÅ
:[EMAIL PROTECTED]
 To Php Gurus:

 I'm writing some code  like this:
  echo(tda

href=javascript:popUp('bios/bio_.$row[scoutname]..html').$row[scoutbi
 o]./a/td);

 but the scoutname is something like Mike Johnson, which has a space in
 bettwen Mike and Johnson, how do I chop this space off, so I can name the
 corresponding html file as bio_MikeJohnson ?
 Thanks and any feedback will be appreciated!

 Good Day.

 Bo





-- 
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php




[PHP-DB] string

2002-07-21 Thread bo

Hi,

for any email end with @companyemail.com
such as [EMAIL PROTECTED]
how do I strip only the portion(in this case:bo) before the common
ending:@companyemail.com ?
Thanks a bunch!

PHP: the solution to the web problem
Best Regards to PHP Community

Bo




-- 
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php




Re: [PHP-DB] string

2002-07-21 Thread Ray Hunter

list( name, rest ) = explode( '@', $email );

name = everything before the @
rest = everything after @

.: B i g D o g :.



- Original Message - 
From: bo [EMAIL PROTECTED]
To: [EMAIL PROTECTED]
Sent: Sunday, July 21, 2002 4:42 PM
Subject: [PHP-DB] string


 Hi,
 
 for any email end with @companyemail.com
 such as [EMAIL PROTECTED]
 how do I strip only the portion(in this case:bo) before the common
 ending:@companyemail.com ?
 Thanks a bunch!
 
 PHP: the solution to the web problem
 Best Regards to PHP Community
 
 Bo
 
 
 
 
 -- 
 PHP Database Mailing List (http://www.php.net/)
 To unsubscribe, visit: http://www.php.net/unsub.php


-- 
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php




[PHP-DB] Hex Help Please...

2002-07-21 Thread Georgie Casey

Rite,

There's a PHP script that takes a monochrome BMP and converts it into some
sort of hex code and I've noticed some patterns with this code. This image
is 72 pixels wide by 14 high so there's 1008 pixels. In the code returned,
theres 252 chars, which is 1008 divided by 4.

So I guessed the image is split into 4 pixels each. So if I pass an image
with the first pixel black and everyhting else white, it returns 8 for those
4. If I pass an image with the first and second black, it returns c.

With the first three black, it returns e. With the first 4, f. And if I have
the 5th pixel black it goes onto the next char code, eg returning f for the
first 4 pixels, then 8 for the 5th pixel black, ie the first pixel in the
next 4. In total it returns f8.

PS
I tried reading in each pixel of the script, checking if it was black or
white, 1 for black, 0 for white. Then converting these 0s and 1s from
decimal to hex, then converting from binary to hex, but to no avail. Then I
tried taking a set of 4 1s or 0s and converting them, but still no luck.

So my questions is, does anyone know how theyre encoding the image I
could probably could decipher the coding with some experimentation but it
really looks like hex and I might be wasting my time.

TIA







-- 
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php




[PHP-DB] Re: Hex Help Please...

2002-07-21 Thread Georgie Casey

OK, i thought I found my solution but...

How come if I convert from 1000 from Binary to Hex in calculator, it
returns 8, but when I use the PHP bin2hex function, it returns loads of 3s
and 0s


Georgie Casey [EMAIL PROTECTED] wrote in message
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
 Rite,

 There's a PHP script that takes a monochrome BMP and converts it into some
 sort of hex code and I've noticed some patterns with this code. This image
 is 72 pixels wide by 14 high so there's 1008 pixels. In the code returned,
 theres 252 chars, which is 1008 divided by 4.

 So I guessed the image is split into 4 pixels each. So if I pass an image
 with the first pixel black and everyhting else white, it returns 8 for
those
 4. If I pass an image with the first and second black, it returns c.

 With the first three black, it returns e. With the first 4, f. And if I
have
 the 5th pixel black it goes onto the next char code, eg returning f for
the
 first 4 pixels, then 8 for the 5th pixel black, ie the first pixel in the
 next 4. In total it returns f8.

 PS
 I tried reading in each pixel of the script, checking if it was black or
 white, 1 for black, 0 for white. Then converting these 0s and 1s from
 decimal to hex, then converting from binary to hex, but to no avail. Then
I
 tried taking a set of 4 1s or 0s and converting them, but still no luck.

 So my questions is, does anyone know how theyre encoding the image I
 could probably could decipher the coding with some experimentation but it
 really looks like hex and I might be wasting my time.

 TIA









-- 
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php




RE: [PHP-DB] the space in php (2)

2002-07-21 Thread Russ

Bo:

Why do you not just store the name's of the people you wish to display
as FirstName and LastName in two different columns?

If for some reason you can't or don't want to do it this way then try
using str_replace() should do what you want:
http://www.php.net/manual/en/function.str-replace.php

As for the code, best do things one step at a time: 
(Assumes MySQL DB)

//1). Get DB record/s:
while($row=mysql_fetch_assoc($result))
{
//2). Get all vars into varspace as columnames:
extract($row);

//3). Echo vars as columnnames to page with as less code as
possible:
echo(tda href=javascript:popUp('bios/bio_ .
str_replace(% %,,$scoutname) .
.html') .
$scoutbio . /a/td);
}
//4). Complete your HTML table:
echo 
/tr
/table
;

I'm not sure the syntax is 100% correct - best check out the manual eh?
;-)
HTH Russ :-)

-Original Message-
From: bo [mailto:[EMAIL PROTECTED]]
Sent: Monday, July 22, 2002 6:11 AM
To: [EMAIL PROTECTED]
Subject: [PHP-DB] the space in php


To Php Gurus:

I'm writing some code  like this:
 echo(tda
href=javascript:popUp('bios/bio_.$row[scoutname]..html').$row[sco
utbi
o]./a/td);

but the scoutname is something like Mike Johnson, which has a space in
bettwen Mike and Johnson, how do I chop this space off, so I can name
the
corresponding html file as bio_MikeJohnson ?
Thanks and any feedback will be appreciated!

Good Day.

Bo



-- 
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



-Original Message-
From: bo [mailto:[EMAIL PROTECTED]]
Sent: Monday, July 22, 2002 6:26 AM
To: [EMAIL PROTECTED]
Subject: [PHP-DB] the space in php (2)


Indeed, it's better that if I can just stop when I encouter a space
before
Johnson, and take the first name(Mike) off. So, the file name will be
bio_Mike.html


Thanks
Bo



-- 
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



--
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php




[PHP-DB] To Bo

2002-07-21 Thread Adam Royle

Study these two parts in the manual, and you will know how to do everything you've 
mentioned (and more).

http://www.php.net/manual/en/ref.strings.php

http://www.php.net/manual/en/ref.array.php

Adam



[PHP-DB] server performance

2002-07-21 Thread eat pasta type fasta

Not exactly a PHP question, but you guys will know,

is there a significant performance difference in how long does it take a 
server to find files as the directories become more nested,

eg.

1. file index.php uses images from directory DIR

vs.

2. file index.php uses images from directory images/DIR

vs.

3. file index.php uses images from directory files/images/DIR

Thanks in advance,

R



--__-__-__
eat pasta
type fasta


-- 
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php




[PHP-DB] Re: To Bo

2002-07-21 Thread bo

Hi, Adam
Thank you, indeed right after I post my question, I was able to use strpos
and substr functions to solve my problem.

Thanks a  lot.

Sincerely
Bo
Adam Royle [EMAIL PROTECTED]
??:001901c2311d$f5ea97c0$[EMAIL PROTECTED]
Study these two parts in the manual, and you will know how to do everything
you've mentioned (and more).

http://www.php.net/manual/en/ref.strings.php

http://www.php.net/manual/en/ref.array.php

Adam




-- 
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php




Re: [PHP-DB] string

2002-07-21 Thread bo

Hi, .: B i g D o g :.

Thank you, indeed right after I post my question, I was able to use strpos
and substr functions to solve my problem. But yours is even simpler with
only one function, cheers.

Thanks a  lot.

Sincerely
Bo
Ray Hunter [EMAIL PROTECTED]
??:01a901c23108$8a881a30$[EMAIL PROTECTED]
 list( name, rest ) = explode( '@', $email );

 name = everything before the @
 rest = everything after @

 .: B i g D o g :.



 - Original Message -
 From: bo [EMAIL PROTECTED]
 To: [EMAIL PROTECTED]
 Sent: Sunday, July 21, 2002 4:42 PM
 Subject: [PHP-DB] string


  Hi,
 
  for any email end with @companyemail.com
  such as [EMAIL PROTECTED]
  how do I strip only the portion(in this case:bo) before the common
  ending:@companyemail.com ?
  Thanks a bunch!
 
  PHP: the solution to the web problem
  Best Regards to PHP Community
 
  Bo
 
 
 
 
  --
  PHP Database Mailing List (http://www.php.net/)
  To unsubscribe, visit: http://www.php.net/unsub.php




-- 
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php




[PHP-DB] Re: server performance

2002-07-21 Thread Chris Earle

I think that's entirely dependent on the server's OS.  If the OS has a
problem, then yes, obviously, otherwise I don't see a reason (unless there
is a bug) for significant speed loss.
Eat Pasta Type Fasta [EMAIL PROTECTED] wrote in message
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
 Not exactly a PHP question, but you guys will know,

 is there a significant performance difference in how long does it take a
 server to find files as the directories become more nested,

 eg.

 1. file index.php uses images from directory DIR

 vs.

 2. file index.php uses images from directory images/DIR

 vs.

 3. file index.php uses images from directory files/images/DIR

 Thanks in advance,

 R



 --__-__-__
 eat pasta
 type fasta




-- 
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php




[PHP-DB] search syntax

2002-07-21 Thread Matthew K. Gold

hi everyone,

I'm writing the code to make my mysql database searchable.  I can search two
columns, but I seem to have problems when I try to search three.

In the SELECT statement, this WHERE statement works:  WHERE column1 OR
column2 LIKE '%$search%' AND...

This WHERE statement doesn't work:  WHERE column1 OR column2 OR column3 LIKE
'%$search%' AND ...

I'm obviously having a syntax problem...Thanks in advance for your help.
And in case any of this is confusing, I'll include the real code below.

Thanks,

Matt


$get_data = select course.CourseNumber, course.CourseTitle,
concat(prof.ProfFName, \ \, prof.ProfLName), instit.InstitName,
disc.DiscName, course.Format from course, disc, instit, prof where
course.CourseTitle or course.CourseDesc or disc.DiscName like '%$search%'
and course.DiscID = disc.DiscID and course.InstitID = instit.InstitID and
course.ProfID = prof.ProfID order by $orderby;






-- 
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php




Re: [PHP-DB] search syntax

2002-07-21 Thread Tony

Try break up the query, like:

WHERE (column1 LIKE '%$search%' OR column2 LIKE '%$search%' OR column3 LIKE
'%$search%') AND ...

Tony S. Wu


Matthew K. Gold at [EMAIL PROTECTED] wrote:

 hi everyone,
 
 I'm writing the code to make my mysql database searchable.  I can search two
 columns, but I seem to have problems when I try to search three.
 
 In the SELECT statement, this WHERE statement works:  WHERE column1 OR
 column2 LIKE '%$search%' AND...
 
 This WHERE statement doesn't work:  WHERE column1 OR column2 OR column3 LIKE
 '%$search%' AND ...
 
 I'm obviously having a syntax problem...Thanks in advance for your help.
 And in case any of this is confusing, I'll include the real code below.
 
 Thanks,
 
 Matt
 
 
 $get_data = select course.CourseNumber, course.CourseTitle,
 concat(prof.ProfFName, \ \, prof.ProfLName), instit.InstitName,
 disc.DiscName, course.Format from course, disc, instit, prof where
 course.CourseTitle or course.CourseDesc or disc.DiscName like '%$search%'
 and course.DiscID = disc.DiscID and course.InstitID = instit.InstitID and
 course.ProfID = prof.ProfID order by $orderby;
 
 
 
 
 




-- 
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php




Re: [PHP-DB] search syntax

2002-07-21 Thread Matthew K. Gold

Great--it works now.  Thanks very much, Tony.  I appreciate your help.

best,

Matt

- Original Message -
From: Tony [EMAIL PROTECTED]
To: Matthew K. Gold [EMAIL PROTECTED]; [EMAIL PROTECTED]
Sent: Monday, July 22, 2002 1:01 AM
Subject: Re: [PHP-DB] search syntax


 Try break up the query, like:

 WHERE (column1 LIKE '%$search%' OR column2 LIKE '%$search%' OR column3
LIKE
 '%$search%') AND ...

 Tony S. Wu


 Matthew K. Gold at [EMAIL PROTECTED] wrote:

  hi everyone,
 
  I'm writing the code to make my mysql database searchable.  I can search
two
  columns, but I seem to have problems when I try to search three.
 
  In the SELECT statement, this WHERE statement works:  WHERE column1 OR
  column2 LIKE '%$search%' AND...
 
  This WHERE statement doesn't work:  WHERE column1 OR column2 OR column3
LIKE
  '%$search%' AND ...
 
  I'm obviously having a syntax problem...Thanks in advance for your help.
  And in case any of this is confusing, I'll include the real code below.
 
  Thanks,
 
  Matt
 
 
  $get_data = select course.CourseNumber, course.CourseTitle,
  concat(prof.ProfFName, \ \, prof.ProfLName), instit.InstitName,
  disc.DiscName, course.Format from course, disc, instit, prof where
  course.CourseTitle or course.CourseDesc or disc.DiscName like
'%$search%'
  and course.DiscID = disc.DiscID and course.InstitID = instit.InstitID
and
  course.ProfID = prof.ProfID order by $orderby;
 
 
 
 
 





-- 
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php




[PHP-DB] Re: how can this be? GET instead of POST - db error

2002-07-21 Thread Chris Earle

The person could have been trying to break into the DB.

Andy [EMAIL PROTECTED] wrote in message
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
 Hi everybody,

 I am just trying to find out how some db errors happened during a user was
 browsing my web app.

 This is out of the Apache log:

 GET /subapp_profiles/act_upload_image.php HTTP/1.1 200 160
 POST /subapp_profiles/act_upload_image.php HTTP/1.1 302 5

 I do not have a clue where this GET request could come from. This has
caused
 a empty sql statement and therefore a db error. How can could this be
 achieved? By clicking back in the browser window? I dont think so since
the
 same user was on another site before.

 Has anybody a idea on that?

 Andy





-- 
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php




[PHP-DB] RE: [PHP] Hex Help Please...

2002-07-21 Thread Martin Towell

Doesn't look like anyone has replied to you on the php-general mailing list.

Have a look at this page
http://www.wotsit.org/search.asp?s=graphics
some of the docs there might help you

HTH
Martin

-Original Message-
From: Georgie Casey [mailto:[EMAIL PROTECTED]]
Sent: Monday, July 22, 2002 6:16 PM
To: [EMAIL PROTECTED]; [EMAIL PROTECTED]
Subject: [PHP] Hex Help Please...


Rite,

There's a PHP script that takes a monochrome BMP and converts it into some
sort of hex code and I've noticed some patterns with this code. This image
is 72 pixels wide by 14 high so there's 1008 pixels. In the code returned,
theres 252 chars, which is 1008 divided by 4.

So I guessed the image is split into 4 pixels each. So if I pass an image
with the first pixel black and everyhting else white, it returns 8 for those
4. If I pass an image with the first and second black, it returns c.

With the first three black, it returns e. With the first 4, f. And if I have
the 5th pixel black it goes onto the next char code, eg returning f for the
first 4 pixels, then 8 for the 5th pixel black, ie the first pixel in the
next 4. In total it returns f8.

PS
I tried reading in each pixel of the script, checking if it was black or
white, 1 for black, 0 for white. Then converting these 0s and 1s from
decimal to hex, then converting from binary to hex, but to no avail. Then I
tried taking a set of 4 1s or 0s and converting them, but still no luck.

So my questions is, does anyone know how theyre encoding the image I
could probably could decipher the coding with some experimentation but it
really looks like hex and I might be wasting my time.

TIA







-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

-- 
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php