Justtechjobs.com Find a programming school near you






Online Campus Both


php3-list | 199901

Re: [PHP3] troubles... From: Sascha Schumann (sas <email protected>)
Date: 01/31/99

On Sun, Jan 31, 1999 at 05:54:52PM +0100, Valerio Fioretti wrote:
>
> 1) I'm using the explode command to split the 'filename' string in more
> than one, if the user input more words. $words = explode (" ",$text);
> How do I manage them if I don't know how many strings $word[] will be
> generated ??

sizeof($words) will give you the number of elements in that array.

> 2) How do I make a search on both 'filename' and 'notes' columns,
> conditioned by the 'section' with the above strings ?

SELECT ... WHERE filename LIKE '...' AND notes LIKE '...'

I'm no MySQL expert, see the MySQL manual on how to search char/text fields.

> 3) How do I make a search for and ALL value in the 'section' field ?

Normally, you would append to the above SELECT statement

... AND section = 'sth'

Just leave out that specific part and your SQL server will select all columns.

-- 
                     
          Regards,
						                                
                            Sascha Schumann | 
                                 Consultant | finger sas <email protected>
                                            | for PGP public key

-- PHP 3 Mailing List http://www.php.net/ To unsubscribe send an empty message to php3-unsubscribe <email protected> To subscribe to the digest list: php3-digest-subscribe <email protected> For help: php3-help <email protected> Archive: http://www.php.net/mailsearch.php3 List administrator: zeev-list-admin <email protected>