OSEC

Neohapsis is currently accepting applications for employment. For more information, please visit our website www.neohapsis.com or email hr@neohapsis.com
 
php-general-digest-help_at_lists.php.net
Date: Fri Jul 26 2002 - 08:25:07 CDT

  • Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]

    php-general Digest 26 Jul 2002 13:25:07 -0000 Issue 1487

    Topics (messages 109642 through 109718):

    Re: arrays, variables, and register_globals--solved--thank you
            109642 by: David Robley

    Re: Password Generator Script
            109643 by: K.Tomono
            109645 by: K.Tomono

    Re: timestamp triggered only on update?
            109644 by: John Holmes

    Re: install issues on Solaris
            109646 by: David Robley
            109648 by: Peter
            109652 by: Peter
            109659 by: David Robley
            109663 by: Peter

    Announcement: Stock Quote Script
            109647 by: Gaylen Fraley

    Re: Paying Job...
            109649 by: Jason
            109676 by: Jason Stechschulte

    Re: Strange problem with objects
            109650 by: Analysis & Solutions

    Re: Help invoking a regexp
            109651 by: Analysis & Solutions
            109716 by: Nicklas af Ekenstam

    PHP 4.2.2 and Apache LoadModule issue
            109653 by: Frank S. Kicenko
            109655 by: Bob Lockie
            109656 by: Peter

    Re: How to defeat winroute [proxy]?
            109654 by: Bob Lockie
            109658 by: Evgeny Chuykov
            109661 by: Bob Lockie
            109688 by: JJ Harrison

    pg_pconnect() question
            109657 by: Varsha Agarwal
            109672 by: Sukumar .S

    urlencode vs rawurlencode
            109660 by: Bob Lockie
            109662 by: Martin Towell
            109665 by: David Robley
            109666 by: Leif K-Brooks
            109668 by: Peter J. Schoenster
            109671 by: Bob Lockie
            109673 by: Martin Towell
            109687 by: JJ Harrison
            109690 by: John Lim

    Object oriented??
            109664 by: Mike Mannakee
            109667 by: Martin Towell
            109670 by: Peter J. Schoenster
            109680 by: Manuel Lemos
            109686 by: JJ Harrison

    what is the .Xauthority file
            109669 by: Sailom

    Re: pdflib, NEED HELP with function problem (newby)
            109674 by: Jason Wong

    Re: conditional image generation problem
            109675 by: Miguel Cruz

    POSTing Form Vars as Array ??
            109677 by: Monty
            109679 by: Miguel Cruz

    Re: [PHP-DB] Re: arrays, variables, and register_globals
            109678 by: David Robley

    Re: Implement PHP within a string
            109681 by: René Moonen
            109700 by: Joshua E Minnie

    Re: New way to make select boxes auto select
            109682 by: Alexander Kuznetsov
            109718 by: lallous

    Re: Inserting Processed Data from One Table 2 Another!
            109683 by: Thomas Edison Jr.

    Re: Newman Asks, Do i have to use session_name('sid') every ...
            109684 by: Tech Support

    PHP Integration...
            109685 by: Brian McGarvie

    Generating Keywords from text
            109689 by: JJ Harrison
            109696 by: Johan Holst Nielsen
            109713 by: JJ Harrison

    About Setcookie function
            109691 by: AlNadabi Network

    Possible to have optional values in function?
            109692 by: JJ Harrison
            109694 by: Jason Wong
            109695 by: René Moonen
            109717 by: JJ Harrison

    Re: header function
            109693 by: k a m e s h
            109697 by: Alexander Kuznetsov

    Re: Applying XSL to XML with PHP
            109698 by: ctan

    my application is not able to communicate with qmail sever !
            109699 by: Sreedhar Katikireddy

    [CROSS POST] PHP Meetup & Texas PHP Users
            109701 by: Jay Blanchard

    cannot find output from lex - Installing PHP 4.2.2
            109702 by: Daniel Guerrier
            109712 by: Alexander Kuznetsov

    How to check if a field is auto increment
            109703 by: Mathieu Dumoulin
            109704 by: Mathieu Dumoulin
            109706 by: Jay Blanchard
            109711 by: Mathieu Dumoulin
            109714 by: Jay Blanchard

    getting days of week out of weeknumber and year
            109705 by: Rainer Schreiber
            109715 by: lallous

    selcet statement question
            109707 by: Tyler Durdin
            109708 by: Paul France
            109709 by: Miles Thompson
            109710 by: Jay Blanchard

    Administrivia:

    To subscribe to the digest, e-mail:
            php-general-digest-subscribelists.php.net

    To unsubscribe from the digest, e-mail:
            php-general-digest-unsubscribelists.php.net

    To post to the list, e-mail:
            php-generallists.php.net

    ----------------------------------------------------------------------

    attached mail follows:


    On 25 Jul 2002 at 20:11, Matthew K. Gold wrote:

    > ----- Original Message -----
    > From: David Robley <robleydparadise.net.nz>
    > To: Matthew K. Gold <mgold1gc.cuny.edu>
    > Sent: Thursday, July 25, 2002 7:14 PM
    > Subject: Re: arrays, variables, and register_globals--solved--thank you
    >
    >
    > > On 25 Jul 2002 at 11:48, Matthew K. Gold wrote:
    > >
    > > > Thank you very much, David--you understood the problem exactly and
    > > > your solution worked perfectly!
    > >
    > > Comes from bitter experience - and working with other languages that
    > > share
    > that
    > > feature.
    > > >
    > > > I'd like to add a comment about mysql_data_seek to the php manual
    > > > entry
    > on
    > > > mysql_fetch_row, because I would think that this might be a common
    > > > problem...
    > > >
    > > > Matt
    > >
    > > You should be aware that this is not restricted to mysql_fetch_row; the
    > principle
    > > applies to arrays generally (see reset, current, each, next and
    > > previous)
    > and as I
    > > mention above, is a general feature across many languages.
    > >
    > > It's really a necessity :-) if you want to be able to work your way
    > through an
    > > array without actually specifying the position of each element (which
    > > gets
    > messy
    > > with associative arrays) the language needs to be able to keep track of
    > where it is
    > > in the array, so it knows where to go next.
    > >
    > > Anyway, the main thing is your problem is resolved.
    > thanks, David, for the additional info. Actually, the one case in which
    > it's not working well is when the query returns an empty table. In the
    > manual listing for mysql_data_seek someone suggests counting the rows with
    > mysql_num_rows, and then, if it's zero, doing something like printing out
    > an appropriate message. What I'm trying to figure out, though, is how to
    > integrate that with a mysql_data_seek line that sets the count back to
    > zero after printing a variable, and a while loop.
    >
    > I'm kind of hopeful, though, that I can figure that out. I'm just getting
    > into programming, and I'm finding that it's fun to run into a problem and
    > then solve it--although if the solution takes too long, it starts getting
    > really frustrating. But that's where people like you come in--thanks
    > again for all of your help. I appreciate it.
    >
    > best,
    >
    > Matt
    >
    >

    Hmm, forgot to cc the list with my previous reply. There is really no conflict
    between array pointers and mysql_num_rows; you just call mysql_num_rows with
    the result set as an argument. In any case, you should be doing that
    immediately after you make the query, before you attempt to process the results.

    PS - do you think you can convince Outhouse not to top-quote?

    Cheers

    -- 
    David Robley
    Temporary Kiwi!
    Quod subigo farinam
    

    "I'm knitting a sweater for my guppy," said Tom wolfishly.

    attached mail follows:


    function generate_passwd($length = 50) { $pass = ""; // all the chars we want to use $all = explode(" ", "a b c d e f g h j k m n p q r s t w x y z " ."A B C D E F G H J K L M N P Q R S T W X Y Z " ."2 3 4 5 6 7 8 9"); for($i=0;$i<$length;$i++)

    srand((double)microtime()*1000000); $randy = rand(0, 50); if ($all[$randy]!=" ")

    $pass .= $all[$randy]; if (strlen($pass)>7)

    return $pass; } } } } $password = generate_passwd(8);

    --
    I got the above script these days from
    http://www.devnetwork.net/forums/viewforum.php?f=1.
    

    FYI

    K.Tomono

    > -----Original Message----- > From: Monty [mailto:monty3hotmail.com] > Sent: Thursday, July 25, 2002 1:49 PM > To: php-generallists.php.net > Subject: [PHP] Password Generator Script > > > Can anyone recommend where I could find a decent script that > automatically > generates passwords? I don't care if they are readable or just random > letters, numbers. > > Thanks! > > > -- > PHP General Mailing List (http://www.php.net/) > To unsubscribe, visit: http://www.php.net/unsub.php >

    attached mail follows:


    function generate_passwd($length = 50) { $pass = ""; // all the chars we want to use $all = explode(" ", "a b c d e f g h j k m n p q r s t w x y z " ."A B C D E F G H J K L M N P Q R S T W X Y Z " ."2 3 4 5 6 7 8 9"); for($i=0;$i<$length;$i++)

    srand((double)microtime()*1000000); $randy = rand(0, 50); if ($all[$randy]!=" ")

    $pass .= $all[$randy]; if (strlen($pass)>7)

    return $pass; } } } } $password = generate_passwd(8);

    --
    I got the above script these days from
    http://www.devnetwork.net/forums/viewforum.php?f=1.
    

    FYI

    K.Tomono

    > -----Original Message----- > From: Monty [mailto:monty3hotmail.com] > Sent: Thursday, July 25, 2002 1:49 PM > To: php-generallists.php.net > Subject: [PHP] Password Generator Script > > > Can anyone recommend where I could find a decent script that > automatically > generates passwords? I don't care if they are readable or just random > letters, numbers. > > Thanks! > > > -- > PHP General Mailing List (http://www.php.net/) > To unsubscribe, visit: http://www.php.net/unsub.php >

    attached mail follows:


    > Im used to for instance 2 columns in each table indicating when it was > created and when it was last updated: > > Changed_date > Registered_date > > In mysql it seems it is only possible to define a column as a timestamp, > and > this will trigger both on insert and delete. Is it possible to define > changed_date to trigger only on update in mysql or do i have do give the > correct timestamp "manually" from php?

    I don't really understand your question. MySQL will update the first timestamp in a table on an INSERT or UPDATE to the current time. Other timestamp columns will remain unchanged. It sounds like you could put changed_date first, so it's always updated with each UPDATE, and put registered_date second so that it's only set when the row is first INSERTed.

    You can also use a DATETIME column, which is exactly the same; it's just not updated automagically.

    ---John Holmes...

    attached mail follows:


    In article <DPEPKCNEFOKBCNNANCIPOEAICHAA.phpvfsa.com.au>, phpvfsa.com.au says... > > In article <DPEPKCNEFOKBCNNANCIPEEOMCGAA.phpvfsa.com.au>, > > phpvfsa.com.au > > says... > > > ok unix.h problem solved but now it's saying can't locate > > .libs/libZend.a > > > .... any ideas? > > > > > > > > > > Furrfu - don't tar all *nix with the same brush :-) Presumably, for some > > reason, that file hasn't been created? Have a look in the libs directory > > under your tarball extraction directory; but perhaps the few lines out of > > make output prior to the error might be useful? > > the last few lines of the make are as follows: > > . > . > . > . > . > . > zend_sprintf.lo `test -f zend_sprintf.c || echo './'`zend_sprintf.c > /bin/sh ../libtool --silent --mode=compile > gcc -DHAVE_CONFIG_H -I. -I. -I../mainzend_ini.lo `test -f zend_ini.c || echo > './'`zend_ini.c > /bin/sh ../libtool --silent --mode=compile > gcc -DHAVE_CONFIG_H -I. -I. -I../mainzend_qsort.lo `test -f zend_qsort.c || > echo './'`zend_qsort.c > /bin/sh ../libtool --silent --mode=link > c -g -O2 -prefer-non-pic -static -o.lo zend_ini_scanner.lo zend_alloc.lo > zend_compile.lo zend_constants.lo zend_dyn.lo zend_opcode.lo > zend_operators.lo zend_ptr_stack.lo zend_stack.lo zend_variabndent.lo > zend_builtin_functions.lo zend_sprintf.lo zend_ini.lo zend_qsort.lo -ld

    > ../libtool: ar: not found

    Haven't we been here previously :-( ar is missing, and IIRC once you get past that you need to also have lex/flex; found in /usr/ccs/bin, is it not?

    > make[1]: *** [libZend.la] Error 1 > make[1]: Leaving directory `/usr/local/php-4.2.2/Zend' > make: *** [all-recursive] Error 1 > > Cheers > Peter > >

    Cheers

    -- 
    David Robley
    Temporary Kiwi!
    

    Quod subigo farinam

    attached mail follows:


    > > zend_sprintf.lo `test -f zend_sprintf.c || echo './'`zend_sprintf.c > > /bin/sh ../libtool --silent --mode=compile > > gcc -DHAVE_CONFIG_H -I. -I. -I../mainzend_ini.lo `test -f > zend_ini.c || echo > > './'`zend_ini.c > > /bin/sh ../libtool --silent --mode=compile > > gcc -DHAVE_CONFIG_H -I. -I. -I../mainzend_qsort.lo `test -f > zend_qsort.c || > > echo './'`zend_qsort.c > > /bin/sh ../libtool --silent --mode=link > > c -g -O2 -prefer-non-pic -static -o.lo zend_ini_scanner.lo > zend_alloc.lo > > zend_compile.lo zend_constants.lo zend_dyn.lo zend_opcode.lo > > zend_operators.lo zend_ptr_stack.lo zend_stack.lo zend_variabndent.lo > > zend_builtin_functions.lo zend_sprintf.lo zend_ini.lo zend_qsort.lo -ld > > > ../libtool: ar: not found > > Haven't we been here previously :-( ar is missing, and IIRC once you get > past that you need to also have lex/flex; found in /usr/ccs/bin, is it > not?

    nope that was unix.h ;) but any way i have lex/flex haven't found any where (online or in books that i have) that say i need IIRC.... as for the ar.... it's located in

    /usr/local/sparc-sun-solaris2.8

    i didn't put it there .. but that's where i found it .. is there any way to tell it to look there for it?

    attached mail follows:


    have solved it .. now got prob with apache hehehe but will hastle the relevant group for that one... thanks for ur help dave

    > -----Original Message----- > From: Peter [mailto:phpvfsa.com.au] > Sent: Friday, 26 July 2002 11:47 AM > To: php-generallists.php.net > Subject: RE: [PHP] install issues on Solaris > > > > > zend_sprintf.lo `test -f zend_sprintf.c || echo './'`zend_sprintf.c > > > /bin/sh ../libtool --silent --mode=compile > > > gcc -DHAVE_CONFIG_H -I. -I. -I../mainzend_ini.lo `test -f > > zend_ini.c || echo > > > './'`zend_ini.c > > > /bin/sh ../libtool --silent --mode=compile > > > gcc -DHAVE_CONFIG_H -I. -I. -I../mainzend_qsort.lo `test -f > > zend_qsort.c || > > > echo './'`zend_qsort.c > > > /bin/sh ../libtool --silent --mode=link > > > c -g -O2 -prefer-non-pic -static -o.lo zend_ini_scanner.lo > > zend_alloc.lo > > > zend_compile.lo zend_constants.lo zend_dyn.lo zend_opcode.lo > > > zend_operators.lo zend_ptr_stack.lo zend_stack.lo zend_variabndent.lo > > > zend_builtin_functions.lo zend_sprintf.lo zend_ini.lo > zend_qsort.lo -ld > > > > > ../libtool: ar: not found > > > > Haven't we been here previously :-( ar is missing, and IIRC once you get > > past that you need to also have lex/flex; found in /usr/ccs/bin, is it > > not? > > nope that was unix.h ;) but any way i have lex/flex haven't found > any where > (online or in books that i have) that say i need IIRC.... as for > the ar.... > it's located in > > /usr/local/sparc-sun-solaris2.8 > > i didn't put it there .. but that's where i found it .. is there > any way to > tell it to look there for it? > > > -- > PHP General Mailing List (http://www.php.net/) > To unsubscribe, visit: http://www.php.net/unsub.php > >

    attached mail follows:


    In article <DPEPKCNEFOKBCNNANCIPKEBCCHAA.phpvfsa.com.au>, phpvfsa.com.au says... > > > zend_sprintf.lo `test -f zend_sprintf.c || echo './'`zend_sprintf.c > > > /bin/sh ../libtool --silent --mode=compile > > > gcc -DHAVE_CONFIG_H -I. -I. -I../mainzend_ini.lo `test -f > > zend_ini.c || echo > > > './'`zend_ini.c > > > /bin/sh ../libtool --silent --mode=compile > > > gcc -DHAVE_CONFIG_H -I. -I. -I../mainzend_qsort.lo `test -f > > zend_qsort.c || > > > echo './'`zend_qsort.c > > > /bin/sh ../libtool --silent --mode=link > > > c -g -O2 -prefer-non-pic -static -o.lo zend_ini_scanner.lo > > zend_alloc.lo > > > zend_compile.lo zend_constants.lo zend_dyn.lo zend_opcode.lo > > > zend_operators.lo zend_ptr_stack.lo zend_stack.lo zend_variabndent.lo > > > zend_builtin_functions.lo zend_sprintf.lo zend_ini.lo zend_qsort.lo -ld > > > > > ../libtool: ar: not found > > > > Haven't we been here previously :-( ar is missing, and IIRC once you get > > past that you need to also have lex/flex; found in /usr/ccs/bin, is it > > not? > > nope that was unix.h ;) but any way i have lex/flex haven't found any where > (online or in books that i have) that say i need IIRC.... as for the ar.... > it's located in > > /usr/local/sparc-sun-solaris2.8 > > i didn't put it there .. but that's where i found it .. is there any way to > tell it to look there for it?

    Sorry, I had been down this exact route with someone else on IRC t'other night :-) Sun/Solaris seems to have odd places for some of its executables, and apparently does't include those places in its path??

    In your case, it sort of sounds like not all the C development stuff got installed (properly)?

    I note from your other message that you are up and running, anyhow.

    Cheers

    -- 
    David Robley
    Temporary Kiwi!
    

    Quod subigo farinam

    attached mail follows:


    > > > Sorry, I had been down this exact route with someone else on IRC t'other > night :-) Sun/Solaris seems to have odd places for some of its > executables, and apparently does't include those places in its path?? > > In your case, it sort of sounds like not all the C development stuff got > installed (properly)? > > I note from your other message that you are up and running, anyhow. > no worries ... i have php up and running but there's a prob with the mod_php4.c in apache.. but any way (that is a auto crated file by apache )... so i figure it must be something before then ... any way will have a look around or just use an older ver of apache either one from sunfreeware.com (which is there i got GNU gcc from as well as 90% of the other programs needed..)

    any way cheers :D

    Peter

    attached mail follows:


    I have released v1.0 of a PHP Stock Quote application. KISSQ (Keep it SimpleStock Quote) will configure as a Nuke module, PostNuke module, or as a stand alone application. Use it to deliver stock quotes, charts, and price history to your site. GPL. See demos at:

    Nuke: http://gaylenandmargie.com/nuke/html PostNuke: http://gaylenandmargie.com/postnuke Stand Alone: http://gaylenandmargie.com/public/stockquote

    --
    Gaylen
    PHP KISGB v4.0.5 Guest Book http://www.gaylenandmargie.com/phpwebsite/
    

    attached mail follows:


    I just thought I would share a personal experience that I am currently going through that relates to this.

    I was approached by a client to develop a full e-commerce solution for his company. I am only one guy, and I had never done any PHP code on this scale before. I knew this, but I wanted to do the job. So I undercut myself. I mean really undercut (in hindsight, I shouldn't have undercut myself as much as I did). I am in the process of delivering a $20,000 - $25,000 website to this company, and I am only making $2000 on it. I have spent close to 700 hours on the development of this project in my evenings and weekends.

    So why did I do it? Three reasons... 1) I wanted the job. 2) I needed a 'good' portfolio piece. 3) I can now buy computer parts cheaper than Future Shop.

    If you decide to charge by the project make sure you know what you're getting yourself into, and that its going to be something you can deliver. Since I have started working on my project I have gained 3 more contracts without even trying just by showing them this project.

    That and being able to say "I did this... ALL BY MYSELF!" is pretty cool.

    Jason L Cathcart BSc. Computer Information Systems jasonbiohazardous.org <mailto:jasonbiohazardous.org>

    -----Original Message----- From: Gerard Samuel [mailto:gsamtrini0.org] Sent: July 25, 2002 9:47 AM To: php-gen Subject: Paying Job...

    Basically, someone is looking to get a database driven site built, and Ive never written code for money before. Im looking for advice, as to how the experienced coders in here charge for their work. Do you charge by the page, script or by the hour (that would be nice).

    Thanks for any input you may provide...

    --
    Gerard Samuel
    http://www.trini0.org:81/
    http://dev.trini0.org:81/
    

    attached mail follows:


    On Thu, Jul 25, 2002 at 12:04:32PM -0400, Brent Baisley wrote: > I don't know how you would charge by the script since you should be > using object oriented code.

    Why should he be using object oriented code? What does that have to do with the end result? Absolutely nothing. He should be using whatever he is most comfortable with since you can achieve the same results with either style.

    -- 
    Jason Stechschulte
    stechypisco.com
    http://www.ypisco.com
    --
    The Tree of Learning bears the noblest fruit, but noble fruit tastes bad.
    

    attached mail follows:


    On Wed, Jul 24, 2002 at 10:21:32PM -0400, Evan wrote: > > $document->session =& $session; > $session->document =& $document;

    Uh, this looks pretty weird.

    First, why assign the objects to each other by reference? The whole point of objects to be able to compartmentalize things and here you're breaking down the separation.

    Second, you assign session to document, but then you assign document to session. This means session will be reassigned to session.

    Overall, that seems quite wasteful.

    > $this is a <?=get_class($this)?><br> > $tihs->session is a <?get_class($this->session)?><br> > > Which returns: > > $this is a rj_document > $this->session is a

    Considering you're getting a blank result and you said $GLOBALS solves the problem, Im' guessing there's a scope problem.

    I strongly suggest you rethink your approach.

    Perhaps, if you need to access $session in $document functions, put a global $session; in the relevant $document functions, and vice versa.

    That'll keep things much cleaner.

    --Dan

    -- 
                   PHP classes that make web design easier
            SQL Solution  |   Layout Solution   |  Form Solution
        sqlsolution.info  | layoutsolution.info |  formsolution.info
     T H E   A N A L Y S I S   A N D   S O L U T I O N S   C O M P A N Y
     4015 7 Av #4AJ, Brooklyn NY     v: 718-854-0335     f: 718-854-0409
    

    attached mail follows:


    Hi Niklas:

    On Fri, Jul 26, 2002 at 01:54:25AM +0200, Nicklas af Ekenstam wrote: > Hi > > I have this regular expression: > > (((http|https|ftp|gopher)|mailto):(//)?[^ <>"\t]*|www\.[-a-z0-9.]+)[^ .,;\t<">\):] > > Which is supposed to match hyperlinks. I would like to use this > from php to grab all hyperlinks in a text file and return them > in an array. > > I've messed around with the function preg_match_all() but I just > can't seem to get it to work. Any suggestions would be very > appreciated. > > Thanks, > Nicklas > > -- > PHP General Mailing List (http://www.php.net/) > To unsubscribe, visit: http://www.php.net/unsub.php

    The mailing list archive: http://groups.google.com/groups?group=php.general

    Good search terms: hyperlink "regular expression"

    Yields this article: http://groups.google.com/groups?q=hyperlink+%22regular+expression%22+group:php.general&hl=en&lr=&ie=UTF-8&safe=off&selm=3A248B2C.13ED233C%40analysisandsolutions.com&rnum=2

    Which has an excellent [shamelessly patting myself on the back] hyperlink regular expression for ereg*:

    "(http://|https://|ftp://|gopher://|news:|mailto:) ([[:alnum:]/!#$%&'()*+,.:;=?~-]+)([[:alnum:]/!#$%&'()*+:;=?~-])"

    Do note, if the last character of the URI is a "," or "." it assumes those are punctuation and leaves them off.

    Enjoy,

    --Dan

    -- 
                   PHP classes that make web design easier
            SQL Solution  |   Layout Solution   |  Form Solution
        sqlsolution.info  | layoutsolution.info |  formsolution.info
     T H E   A N A L Y S I S   A N D   S O L U T I O N S   C O M P A N Y
     4015 7 Av #4AJ, Brooklyn NY     v: 718-854-0335     f: 718-854-0409
    

    attached mail follows:


    On (2002-07-25 23:00), Analysis & Solutions wrote: > The mailing list archive: > http://groups.google.com/groups?group=php.general > > Good search terms: > hyperlink "regular expression" > > Yields this article: > http://groups.google.com/groups?q=hyperlink+%22regular+expression%22+group:php.general&hl=en&lr=&ie=UTF-8&safe=off&selm=3A248B2C.13ED233C%40analysisandsolutions.com&rnum=2 > > Which has an excellent [shamelessly patting myself on the back] hyperlink > regular expression for ereg*: > > "(http://|https://|ftp://|gopher://|news:|mailto:) > ([[:alnum:]/!#$%&'()*+,.:;=?~-]+)([[:alnum:]/!#$%&'()*+:;=?~-])" > > Do note, if the last character of the URI is a "," or "." it assumes those > are punctuation and leaves them off.

    Thanks - that really is one sweet regexp. However my problem is now that I can't figure out how to use it to suit my need. This is what I want:

    Apply above regexp to a string and have it extract all hyperlinks in that string and return them in an array.

    - Nicklas

    attached mail follows:


    Hi All.

    I am having a weird problem... my PHP is outputting a "libphp4.a" and "libphp4.la" modules and I can't get Apache to recognize this type of file. Is there a way to tell PHP to generate a ".so" module? Or how can I get Apache to use the .a and .la modules?

    Thanks.

    attached mail follows:


    On Thu, 25 Jul 2002 22:23:21 -0500, Frank S. Kicenko wrote:

    >Hi All. > >I am having a weird problem... my PHP is outputting a "libphp4.a" and >"libphp4.la" modules and I can't get Apache to recognize this type of >file. Is there a way to tell PHP to generate a ".so" module? Or how can >I get Apache to use the .a and .la modules? > >Thanks. > >-- >PHP General Mailing List (http://www.php.net/) >To unsubscribe, visit: http://www.php.net/unsub.php > --with-apxs in the configure of PHP.

    attached mail follows:


    > -----Original Message----- > From: Bob Lockie [mailto:bjlockielockie.ca] > Sent: Friday, 26 July 2002 1:32 PM > To: Frank S. Kicenko; php-generallists.php.net > Subject: Re: [PHP] PHP 4.2.2 and Apache LoadModule issue > > > On Thu, 25 Jul 2002 22:23:21 -0500, Frank S. Kicenko wrote: > > >Hi All. > > > >I am having a weird problem... my PHP is outputting a "libphp4.a" and > >"libphp4.la" modules and I can't get Apache to recognize this type of > >file. Is there a way to tell PHP to generate a ".so" module? Or how can > >I get Apache to use the .a and .la modules? > > > >Thanks. yeah i had to do

    ./configure --activate-module=src/modules/php4/libmodphp4.a

    attached mail follows:


    On Fri, 26 Jul 2002 09:48:18 +0900, Evgeny Chuykov wrote:

    >Hi. > >I've tried this: > >header("Expires: Mon, 26 Jul 1997 05:00:00 GMT"); >header("Cache-control: private"); >header("Cache-control: no-cache"); >header("Cache-control: no-store"); >header("Cache-control: must-revalidate"); >header("Cache-control: proxy-revalidate"); >header("Cache-control: max-age=0"); >header("Pragma: no-cache"); > >session_cache_limiter('private, must-revalidate'); >( and session_cache_limiter('nocache') ) > >But it doesn't work - winroute cache everything. Does anyone know any >solution? > >-- >Best regards, > Evgeny mailto:geckabaik.ru > > >-- >PHP General Mailing List (http://www.php.net/) >To unsubscribe, visit: http://www.php.net/unsub.php >

    Are you sure WinRoute can be set not to cache everything? I know the old Netscape (the new ones?) didn't have a lot of control over caching.

    attached mail follows:


    BL> On Fri, 26 Jul 2002 09:48:18 +0900, Evgeny Chuykov wrote:

    >>Hi. >> >>I've tried this: >> >>header("Expires: Mon, 26 Jul 1997 05:00:00 GMT"); >>header("Cache-control: private"); >>header("Cache-control: no-cache"); >>header("Cache-control: no-store"); >>header("Cache-control: must-revalidate"); >>header("Cache-control: proxy-revalidate"); >>header("Cache-control: max-age=0"); >>header("Pragma: no-cache"); >> >>session_cache_limiter('private, must-revalidate'); >>( and session_cache_limiter('nocache') ) >> >>But it doesn't work - winroute cache everything. Does anyone know any >>solution?

    BL> Are you sure WinRoute can be set not to cache everything? BL> I know the old Netscape (the new ones?) didn't have a lot of control over caching.

    The problem is that this winroute is not mine. It is used by third party people and they won't change winroute prefs.

    -- 
    Best regards,
     Evgeny                          mailto:geckabaik.ru
    

    attached mail follows:


    >>>Hi. >>> >>>I've tried this: >>> >>>header("Expires: Mon, 26 Jul 1997 05:00:00 GMT"); >>>header("Cache-control: private"); >>>header("Cache-control: no-cache"); >>>header("Cache-control: no-store"); >>>header("Cache-control: must-revalidate"); >>>header("Cache-control: proxy-revalidate"); >>>header("Cache-control: max-age=0"); >>>header("Pragma: no-cache"); >>> >>>session_cache_limiter('private, must-revalidate'); >>>( and session_cache_limiter('nocache') ) >>> >>>But it doesn't work - winroute cache everything. Does anyone know any >>>solution? > >BL> Are you sure WinRoute can be set not to cache everything? >BL> I know the old Netscape (the new ones?) didn't have a lot of control over caching. > >The problem is that this winroute is not mine. It is used by third >party people and they won't change winroute prefs.

    Find out if it is even POSSIBLE to make WinRoute not cache everything. My point is that you *may* be beating your head against a brick wall.

    attached mail follows:


    couldn't you put a random number in the url(It is possible to get apache to parse files with no extension)?

    like http://www.yoursite.com/no_cache_page/random_md5_hash_here/

    That way WinRoute would (hopefully) treat it as a differant page.

    --
    JJ Harrison
    webmastertececo.com
    www.tececo.com
    

    "Bob Lockie" <bjlockielockie.ca> wrote in message news:200207260324.g6Q3OUob015728gw.lockie.ca... > > >>>Hi. > >>> > >>>I've tried this: > >>> > >>>header("Expires: Mon, 26 Jul 1997 05:00:00 GMT"); > >>>header("Cache-control: private"); > >>>header("Cache-control: no-cache"); > >>>header("Cache-control: no-store"); > >>>header("Cache-control: must-revalidate"); > >>>header("Cache-control: proxy-revalidate"); > >>>header("Cache-control: max-age=0"); > >>>header("Pragma: no-cache"); > >>> > >>>session_cache_limiter('private, must-revalidate'); > >>>( and session_cache_limiter('nocache') ) > >>> > >>>But it doesn't work - winroute cache everything. Does anyone know any > >>>solution? > > > >BL> Are you sure WinRoute can be set not to cache everything? > >BL> I know the old Netscape (the new ones?) didn't have a lot of control over caching. > > > >The problem is that this winroute is not mine. It is used by third > >party people and they won't change winroute prefs. > > Find out if it is even POSSIBLE to make WinRoute not cache everything. > My point is that you *may* be beating your head against a brick wall. > > >

    attached mail follows:


    I am trying to connect to postgre_sql database using pg_pconnect(). When I try to run it i get the following error Warning: Unable to connect to PostgreSQL server: FATAL 1: IDENT authentication failed for user "postgres" in /var/www/html/test.php on line 3 connection failed

    Please tell me what might be the reason. -Varsha

    __________________________________________________ Do You Yahoo!? Yahoo! Health - Feel better, live better http://health.yahoo.com

    attached mail follows:


    Hi,

    This is error is coming to you bcoz you have given IDENT as the authentication type in your pg_hba.conf file. Check out this file, whether you have enabled "IDENT" as your auth type. If so configure appropriately users for IDENT authentication.

    For simplicity and for testing purpose, you can just give "trust" for localhost and try whether you are able to connect to postgresql or not.

    -S. Sukumar

    > I am trying to connect to postgre_sql database using > pg_pconnect(). When I try to run it i get the > following error > Warning: Unable to connect to PostgreSQL server: FATAL > 1: IDENT authentication failed for user "postgres" in > /var/www/html/test.php on line 3 > connection failed > > Please tell me what might be the reason. > -Varsha > > __________________________________________________ > Do You Yahoo!? > Yahoo! Health - Feel better, live better > http://health.yahoo.com > . > >

    attached mail follows:


    What is the difference between urlencode and rawurlencode? The documentation isn't clear but I'm sure there is some difference.

    attached mail follows:


    well, doing this:

    <? echo urlencode(" +&") . "\n"; echo rawurlencode(" +&") . "\n"; ?>

    I get this:

    +%2B%26 %20%2B%26

    so it looks like, if it encodes a char, then rawurlencode() will always bring it back to the hex value for it, whereas urlencode() will use "+" for space (dunno about other chars)

    HTH Martin

    -----Original Message----- From: Bob Lockie [mailto:bjlockielockie.ca] Sent: Friday, July 26, 2002 1:51 PM To: php-general Subject: [PHP] urlencode vs rawurlencode

    What is the difference between urlencode and rawurlencode? The documentation isn't clear but I'm sure there is some difference.

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

    attached mail follows:


    In article <200207260322.g6Q3MOob015721gw.lockie.ca>, bjlockielockie.ca says... > What is the difference between urlencode and rawurlencode? > The documentation isn't clear but I'm sure there is some difference.

    Seems to say that urlencode does spaces as '+' and rawurlencode uses'%20'

    -- 
    David Robley
    Temporary Kiwi!
    

    Quod subigo farinam

    attached mail follows:


    I know that space is + with urlencode, and the % code is used in rawurlencode. Not sure of other differences, though. Bob Lockie wrote:

    >What is the difference between urlencode and rawurlencode? >The documentation isn't clear but I'm sure there is some difference. > > > > > >

    attached mail follows:


    On 25 Jul 2002 at 23:50, Bob Lockie wrote:

    > What is the difference between urlencode and rawurlencode? > The documentation isn't clear but I'm sure there is some difference.

    What documenation are you using?

    The one I find here:

    http://www.php.net/manual/en/function.urlencode.php

    is pretty darn good and the user comments are often quite helpful.

    The difference between the 2 is in the encoding of spaces. urlencode uses '+' for spaces whereas rawurlencode uses '%20' for spaces.

    > Returns a string in which all non-alphanumeric characters except -_. > have been replaced with a percent (%) sign followed by two hex digits > and spaces encoded as plus (+) signs. It is encoded the same way that > the posted data from a WWW form is encoded, that is the same way as in > application/x-www-form-urlencoded media type. This differs from the > RFC1738 encoding .

    Peter

    attached mail follows:


    On Fri, 26 Jul 2002 14:00:30 +1000, Martin Towell wrote:

    >well, doing this: > ><? >echo urlencode(" +&") . "\n"; >echo rawurlencode(" +&") . "\n"; >?> > >I get this: > >+%2B%26 >%20%2B%26 > >so it looks like, if it encodes a char, then rawurlencode() will always >bring it back to the hex value for it, whereas urlencode() will use "+" for >space (dunno about other chars)

    I've never seen a + for a space. What uses it that way?

    attached mail follows:


    I think + for space is specified in some rfc somewhere - don't know which one, and I don't know if that rfc has been superceded.

    -----Original Message----- From: Bob Lockie [mailto:bjlockielockie.ca] Sent: Friday, July 26, 2002 3:05 PM To: Martin Towell; php-general Subject: RE: [PHP] urlencode vs rawurlencode

    On Fri, 26 Jul 2002 14:00:30 +1000, Martin Towell wrote:

    >well, doing this: > ><? >echo urlencode(" +&") . "\n"; >echo rawurlencode(" +&") . "\n"; >?> > >I get this: > >+%2B%26 >%20%2B%26 > >so it looks like, if it encodes a char, then rawurlencode() will always >bring it back to the hex value for it, whereas urlencode() will use "+" for >space (dunno about other chars)

    I've never seen a + for a space. What uses it that way?

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

    attached mail follows:


    > I've never seen a + for a space. > What uses it that way? Google for one. when you search for stuff within a site the url is formatted like this:

    http://www.google.com/search?sourceid=navclient&q=site:www.foobar.com+test

    --
    JJ Harrison
    webmastertececo.com
    www.tececo.com
    

    attached mail follows:


    Stick to rawurlencode, there are problems with interpreting '+'. Is it a space or is it a plus.

    "Bob Lockie" <bjlockielockie.ca> wrote in message news:200207260322.g6Q3MOob015721gw.lockie.ca... > What is the difference between urlencode and rawurlencode? > The documentation isn't clear but I'm sure there is some difference. > > >

    attached mail follows:


    I'm curious how the OOP features are viewed in PHP. I'm originally a C++ guy, and took to PHP because of the similarity. In C++ one wouldn't think of not using OOP principles, but frankly I cannot really figure out why one would go to OOP methods in PHP. It's not a true OOP implementation, though for web stuff it's probably close enough. I've written nothing but traditional code in PHP and like it that way. How common is this? Do most people write OOP or traditional linear code in PHP?

    Mike

    attached mail follows:


    It has been mentioned before the various reason when OOP in PHP is handy: 1. There is more than one programmer 2. The project is large 3. There is a need for a common code library across many projects 4. You're modelling something in the real world 5. You're used to OOP

    I can't think of any other reasons at the moment.

    Basically, if you think OOP will come in handy, use it. If you think modular programming will do, use that.

    HTH Martin

    -----Original Message----- From: Mike Mannakee [mailto:mikebasementideas.com] Sent: Friday, July 26, 2002 2:22 PM To: php-generallists.php.net Subject: [PHP] Object oriented??

    I'm curious how the OOP features are viewed in PHP. I'm originally a C++ guy, and took to PHP because of the similarity. In C++ one wouldn't think of not using OOP principles, but frankly I cannot really figure out why one would go to OOP methods in PHP. It's not a true OOP implementation, though for web stuff it's probably close enough. I've written nothing but traditional code in PHP and like it that way. How common is this? Do most people write OOP or traditional linear code in PHP?

    Mike

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

    attached mail follows:


    On 26 Jul 2002 at 0:21, Mike Mannakee wrote:

    > I'm curious how the OOP features are viewed in PHP. I'm originally a > C++ guy, and took to PHP because of the similarity. In C++ one wouldn't > think of not using OOP principles, but frankly I cannot really figure > out why one would go to OOP methods in PHP. It's not a true OOP > implementation, though for web stuff it's probably close enough. I've > written nothing but traditional code in PHP and like it that way. How > common is this? Do most people write OOP or traditional linear code in > PHP?

    Mike,

    I come from Perl :) and I think more modular than OOP. We have linear code in Perl, tons of it. Ever have to debug or evolve websites written in linear Perl? What's really fun are the ones that repeat lines of code 4,5,6 or more times in one hugh file. I've had to work on code written by others since 1998. Let me see, this variable, gee, where does it come from ... oh that file which includes this file if that variable in that file over there is true and .... gives me the creeps. So in Perl I organize code in modules, not "thinking in OO" but organizing my code in hopefully a sensible manner so I can isolate actions, I can trace actions and variables easily. I use the "OO" features of PHP the same way. There are a lot of really nice looking apps written in PHP but I won't touch them. They work or they don't, and if they don't then I never get entangled in them. One thing I'm trying to work out is an MVC approach with PHP. I've got one in Perl and it works great.

    Peter

    attached mail follows:


    Hello,

    On 07/26/2002 01:21 AM, Mike Mannakee wrote: > I'm curious how the OOP features are viewed in PHP. I'm originally a C++ > guy, and took to PHP because of the similarity. In C++ one wouldn't think > of not using OOP principles, but frankly I cannot really figure out why one > would go to OOP methods in PHP. It's not a true OOP implementation, though > for web stuff it's probably close enough. I've written nothing but > traditional code in PHP and like it that way. How common is this? Do most > people write OOP or traditional linear code in PHP?

    OOP is used in PHP mostly for the same reasons why you use OOP in C++ or Java, except that in PHP you have an option.

    -- 
    

    Regards, Manuel Lemos

    attached mail follows:


    I don't use OO in PHP.

    instead I organise functions into files. ie functions for validating user input would go into validate.input.func.php. I then have a single require(or include) called required.php this way I can add 'modules' of code eaisly. To me it seems the same as OO but a little bit faster(in PHP)

    --
    JJ Harrison
    webmastertececo.com
    www.tececo.com
    

    "Mike Mannakee" <mikebasementideas.com> wrote in message news:20020726041651.44568.qmailpb1.pair.com... > I'm curious how the OOP features are viewed in PHP. I'm originally a C++ > guy, and took to PHP because of the similarity. In C++ one wouldn't think > of not using OOP principles, but frankly I cannot really figure out why one > would go to OOP methods in PHP. It's not a true OOP implementation, though > for web stuff it's probably close enough. I've written nothing but > traditional code in PHP and like it that way. How common is this? Do most > people write OOP or traditional linear code in PHP? > > Mike > >

    attached mail follows:


    I just connected to my web server and found that there was a new file named ".Xauthority", which I didn't created. Does anyone know what this file is? Can I delete it?

    Sailom

    attached mail follows:


    On Friday 26 July 2002 08:39, Jeffrey wrote: > Hello, > > Using php v 4.2.2 with pdflib support, on apache v. 1.3, and redhat > linux 7.2. > > I for some reason can not get a pdf_setfont, pdf_set_text_pos, > pdf_[anything], to work inside a function. What is going on. All the pdf > extensions work find as long as I dont try to use them inside a function > that I create. > > ie: > > PDF_set_text_pos($p, 80, 670); > PDF_show($p, "Requirements:"); > > works just fine outside of a function but if I put the same thing inside a > function like so > > > function help() > { > PDF_set_text_pos($p, 80, 670); > PDF_show($p, "Test:"); > } > > I will not get Test text to display inside the PDF document,

    Because $p is undefined inside your function. Use: global $p

    inside your function. Read manual --> Variables --> Variable scope for full details.

    -- 
    Jason Wong -> Gremlins Associates -> www.gremlins.com.hk
    Open Source Software Systems Integrators
    * Web Design & Hosting * Internet & Intranet Applications Development *
    

    /* Once you've seen one nuclear war, you've seen them all. */

    attached mail follows:


    On Thu, 25 Jul 2002, Alex Maslov wrote: > I have a problem with conditional image generation. If I generate an > image without any conditional statments, then everything works fine. But > if i introduce conditional statment, then no image is generated in > either case of the condition. > > Has anyone dealt with this dilema before?

    I would think the problem is in the code that you deleted before posting. There's nothing inherent to if() statements that affects the viability of image generation.

    miguel

    attached mail follows:


    Is it possible to pass variables from a form as an array to another PHP file? For example, I have this:

    <input type="text" name="db['email']" value="<? echo $db['email']; ?>">

    When the form re-loads after being submitted (it calls itself when SUBMIT is pressed), the var $db['email'] doesn't exist anymore.

    Is it only possible to POST variables to a page if they are not in an array?

    Thanks!

    Monty

    attached mail follows:


    On Fri, 26 Jul 2002, Monty wrote: > Is it possible to pass variables from a form as an array to another PHP > file? For example, I have this: > > <input type="text" name="db['email']" value="<? echo $db['email']; ?>">

    You have some extra single quotes in there. Try this:

    <input type="text" name="db[email]" value="<? echo $db['email']; ?>">

    miguel

    attached mail follows:


    On 25 Jul 2002 at 2:04, GOLD, MATTHEW wrote:

    > thank you very much for your quick response. > > How do I run mysql_fetch_row before the while loop? I don't want two > loops, because I just want this variable to print out once. > > I tried this, but it didn't work: > > $query = "Select blah1, blah2, blah3 from blahtable"; > $result = mysql_query ($query) > or die ("Cannot complete query"); > > $row = mysql_fetch_row ($result)) > print ("$row[4]"); > > while ($row = mysql_fetch_row ($result)) > { > print "$row[1], $row[2], etc."); > } > > ?> > > I realize that my problem is that I don't really understand arrays...but I > am new to all of this, and I very much appreciate your help. > > best, > > Matt

    Not sure if I responded to this, so ....

    $query = "Select blah1, blah2, blah3 from blahtable"; $result = mysql_query ($query) or die ("Error: ". $mysql_error() ) //mysql_error gives you a useful error message! // or die ("Cannot complete query");

    $row = mysql_fetch_row ($result)) print ("$row[4]"); mysql_data_seek($result, 0); //Reset pointer to first record while ($row = mysql_fetch_row ($result)) { print "$row[1], $row[2], etc."); }

    ?>

    You might want to look at extract as well.

    Cheers

    -- 
    David Robley
    Temporary Kiwi!
    Quod subigo farinam
    

    "This is mutiny!" said Tom bountifully.

    attached mail follows:


    <snip>

    >Is it possible to run PHP that is embedded within a string? I have a file >that is read into a string and returned to the browser, how can I run that >PHP? > </snip>

    Have a look at

    http://www.php.net/manual/en/function.eval.php

    Good luck

    René

    attached mail follows:


    Thanks, for the help, that worked out great. I was looking under all the string functions I could think of to do what I was looking for and didn't even think of doing eval. I am always greatful for the extra set of eyes this list provides.

    Josh

    > >Is it possible to run PHP that is embedded within a string? I have a file > >that is read into a string and returned to the browser, how can I run that > >PHP? > > > > Have a look at http://www.php.net/manual/en/function.eval.php > > Good luck > > René

    attached mail follows:


    Hello Nathan,

    Thursday, July 25, 2002, 7:33:31 PM, you wrote:

    NC> You may already be doing it like this, but I think I found a new way to NC> make select boxes auto-select (what data they put in) a lot easier. All you NC> have to do is put a variable in each select tag that is equal to the value NC> of the select option i.e.: <option value=teacher $teacher> -- then all you NC> have to do is base the variable on that <select name=interest> $$interest = NC> "selected"; quick and easy with out having to loop through an if elseif NC> statement. Let me know if you like that method or have any objections.

    NC> Full example below.

    NC> print("<select name=interest>\n"); NC> // creates a variable with a name based on NC> // the value of interest with a value of "selected" NC> $$interest = "selected"; NC> print("<option value=>- Select One -</option>\n"); NC> print("<option value=teacher $teacher>Teacher</option>\n"); NC> print("<option value=lego $lego>Lego Enthusiast</option>\n"); NC> print("<option value=student $student>Student</option>\n"); NC> print("<option value=homeschool $homeschool>Homeschool Parent</option>\n"); NC> print("<option value=browsing $browsing>Browsing</option>\n"); NC> print("<option value=afterschool $afterschool>Afterschool</option>\n"); NC> print("<option value=bgca $bgca>Boys & Girls Club</option>\n"); NC> print("<option value=ymca $ymva>YMCA</option>\n"); NC> print("</select>&nbsp;&nbsp;\n");

    NC> [ Nathan Cook | ncookpcsedu.com ]

    I use the same method with templates (class Template in PHPLib), I put on your $teacher var my template var {TEACHER} for example

    and then just assign to {TEACHER} the value "selected"

    -- 
    Best regards,
    Alexander Kuznetsov
    

    attached mail follows:


    I use javascript for that! :)

    <script> function select_lb_by_value(lb, val) { len = lb.options.length; for (i=0;i<len;i++) if (lb[i].value == val) { lb.selectedIndex = i; break; } } </script>

    then I call this: <script> select_lb_by_value(document.form1.selectbox1, '<?=$selectbox1?>'); </script>

    fast and simple,

    //elias

    "Nathan Cook" <ncookpcsedu.com> wrote in message news:001e01c233f9$46f91f00$1500a8c0pcsedu.com... > You may already be doing it like this, but I think I found a new way to > make select boxes auto-select (what data they put in) a lot easier. All you > have to do is put a variable in each select tag that is equal to the value > of the select option i.e.: <option value=teacher $teacher> -- then all you > have to do is base the variable on that <select name=interest> $$interest = > "selected"; quick and easy with out having to loop through an if elseif > statement. Let me know if you like that method or have any objections. > > Full example below. > > print("<select name=interest>\n"); > // creates a variable with a name based on > // the value of interest with a value of "selected" > $$interest = "selected"; > print("<option value=>- Select One -</option>\n"); > print("<option value=teacher $teacher>Teacher</option>\n"); > print("<option value=lego $lego>Lego Enthusiast</option>\n"); > print("<option value=student $student>Student</option>\n"); > print("<option value=homeschool $homeschool>Homeschool Parent</option>\n"); > print("<option value=browsing $browsing>Browsing</option>\n"); > print("<option value=afterschool $afterschool>Afterschool</option>\n"); > print("<option value=bgca $bgca>Boys & Girls Club</option>\n"); > print("<option value=ymca $ymva>YMCA</option>\n"); > print("</select>&nbsp;&nbsp;\n"); > > [ Nathan Cook | ncookpcsedu.com ] > >

    attached mail follows:


    Ok ths is great, a lovely Random Code Generator! Thanks a lot. I always wanted one of these. Actually my problem was a little different, but i was able to solve it. I was using $result twice to store to different SQL Queries, i changed the other one to $result2 and it worked. But in fact, i will now change my code to generate the Random Number which of course is much better! Thanks...

    T. Edison Jr.

    --- Wouter van Vliet <wouterspringt.nl> wrote: > I don't see why your code is so wrong .... but > neither do I see what it > reall does. YOu are changing the clientID with some > simple function into a > password? As in everybody can do that trick by > himself and login as whoever > he wants .. > > What I'll mostly do for such things, is use this > self written function to > generate a random string and use this as generated > password. it takes an > integer as argument, and gives back a random code > with only [A-Z][a-z] > characters of a length of the given argument. > > And then, I'd just use the loop to roll through the > ID's and insert a random > code password. > > function generateRandomString($length) { > srand ((float) microtime() * 1000000); > for ($i=65;$i<91;$i++) { > $chars[] = chr($i); > }; > for ($i=97;$i<122;$i++) { > $chars[] = chr($i); > }; > $chrs = count($chars) - 1; > for ($i=0; $i<$length; $i++) { > $asc = rand(0, $chrs); > $code .= $chars[$asc]; > }; > return $code; > }; > > $result = mysql_query("SELECT clientid FROM > Clientdetails"); > while ($myrow = mysql_fetch_assoc($result)) { > $code = generateRandomString(8); > mysql_query("INSERT INTO authentication (id, pass) > VALUES > ($myrow[clientid], '".$code."'"); > }; > > Hope this helped you ! > > Greetz, > Wouter > > > -----Oorspronkelijk bericht----- > Van: Thomas Edison Jr. > [mailto:thomasedisonjryahoo.com] > Verzonden: woensdag 24 juli 2002 9:02 > Aan: php-generallists.php.net > Onderwerp: [PHP] Inserting Processed Data from One > Table 2 Another! > > > Ok i have simple issue, i'm stuck at one point. > > I have a table "Clientdetails" which contains > ClientID. > I have created another table "Authentication" with 2 > fields, "ClientID" and "Password". > > I want to pick up the ClientID from table > "Clientdetails" and insert "ClientID" and a Password > i > have generated using a code, into "Authentication". > > So if there are 13000 ClientID's in "Clientdetails", > as, many rows with the ClientID & it's corresponding > password should be Inserted into table > "Authentication". > > I'm using the following code which i know is wrong, > what would be correct? > > <? > $db = mysql_connect("localhost","user","pwd"); > mysql_select_db("myDB",$db); > > $result = mysql_query("SELECT * FROM > clientdetails",$db); > if ($myrow = mysql_fetch_array($result)) { > do { > > $some = $myrow[clientid] > $newid = eregi_replace('100', '', $myrow[clientid]); > $date = date("dn"); > $stuff = $newid.def.$date; > > $sql = "INSERT INTO authentication > VALUES('$some','$stuff')"; > $result = mysql_query($sql); > echo "All Done!"; > > } while ($myrow = mysql_fetch_array($result)); > } > > ?> > > Thanks, > T. Edison Jr. > > > > > > __________________________________________________ > Do You Yahoo!? > Yahoo! Health - Feel better, live better > http://health.yahoo.com > > -- > PHP General Mailing List (http://www.php.net/) > To unsubscribe, visit: http://www.php.net/unsub.php > > >

    __________________________________________________ Do You Yahoo!? Yahoo! Health - Feel better, live better http://health.yahoo.com

    attached mail follows:


    if ( eregi('^[php].*newman.*', $subject) && $docs == "unread") move_mail_to_folder("deleted Items");

    Jim Grill Support Web-1 Hosting http://www.web-1hosting.net ----- Original Message ----- From: "Philip J. Newman" <newmanpjphilipnz.com> To: <php-generallists.php.net> Sent: Thursday, July 25, 2002 2:43 AM Subject: [PHP] Newman Asks, Do i have to use session_name('sid') every ...

    > session_name('sid'); > session_start(); > > Do i have to use session_name('sid'); every time i use session_start(); or > can session_name be used once? > > --- > Philip J. Newman. > PhilipNZ.com Design Solutions > http://www.philipnz.com/ > infophilipnz.com > > Mob: +64 (25) 6144012. > Tele: +64 (25) 6144012. > > Personal Site: > Philip J. Newman > Internet Developer > http://www.philipsdomain.com/ > newmanpjphilipsdomain.com > > > > > -- > PHP General Mailing List (http://www.php.net/) > To unsubscribe, visit: http://www.php.net/unsub.php > > >

    attached mail follows:


    OK, I have undertaken a project which requires...

    1) Integration with Outlook (yes the application will only ever be run on windows). 2) Integration with Credit Checking agencies (UK).

    Has anyone ever done any of the 2 above? If so any insight would be verymuch appreciated!!!

    Cheers,

    Brian...

    attached mail follows:


    I want to get keywords from text in a DB.

    That part is easy(split each one into an array variable using explode on spaces).

    The problem is getting a relevancy rating for each keyword and only putting it into the database once.

    Has anyone done this or have any ideas?

    --
    JJ Harrison
    webmastertececo.com
    www.tececo.com
    

    attached mail follows:


    > That part is easy(split each one into an array variable using explode on > spaces). > > The problem is getting a relevancy rating for each keyword and only putting > it into the database once. > > Has anyone done this or have any ideas?

    I will think i would do something like this...

    <?php $Words = explode(" ", $yourtext); $IgnoreWords = array("the", "and", "is", "are", "then"); //... $WordsCount = array_count_values($Words); $WordsCountKeys = array_keys($WordsCount); foreach($WordsCountKeys as $x) { if(!in_array($x, $IgnoreWords)) { if($WordsCount[$x] >= 2) { //word in text 2 times or more //add to keywords } } } ?>

    Maybe this can help you the first way? Maybe there is some errors... im hungry... so I will go out eating :)

    Regards, Johan

    attached mail follows:


    I got it basicly working after a little bit of effort. Thank you.

    BTW earth is repeated four times as earth and four times as earth's. How could I get eight of earth instead of four? give me a function to research and I will.

    Now I will figure out how to get a fair weight.

    --
    JJ Harrison
    webmastertececo.com
    www.tececo.com
    

    "Johan Holst Nielsen" <johan1way2print.net> wrote in message news:3D41241D.20306091way2print.net... > > That part is easy(split each one into an array variable using explode on > > spaces). > > > > The problem is getting a relevancy rating for each keyword and only putting > > it into the database once. > > > > Has anyone done this or have any ideas? > > I will think i would do something like this... > > <?php > $Words = explode(" ", $yourtext); > $IgnoreWords = array("the", "and", "is", "are", "then"); //... > $WordsCount = array_count_values($Words); > $WordsCountKeys = array_keys($WordsCount); > foreach($WordsCountKeys as $x) { > if(!in_array($x, $IgnoreWords)) { > if($WordsCount[$x] >= 2) { file://word in text 2 times or more > file://add to keywords > } > } > } > ?> > > Maybe this can help you the first way? > Maybe there is some errors... im hungry... so I will go out eating :) > > Regards, > Johan >

    attached mail follows:


    Hi There

    I am having small probem in how to set the cookies to all my sub-domains ??

    I tried the all possible choises I know :

    "/" & ".mydomain.net" & ".mydomain.net."

    but no one it work with me :( ...

    and I want to make it clear :

    if u set the cookies path to "/" with the following urls :

    http://www.mydomain.net/chat/ (it will work fine )

    http://chat.mydomain.net/ (it will not work !! )

    and

    http://www.mydomain.net/login/ (it will work fine )

    http://login.mydomain.net/ (it will not work !! )

    So , how to set the cookies for the all domains in my host ?? not the directories ??

    Best Regards AlNadabi

    ============================== AlNadabi Network http://www.alnadabi.net

    attached mail follows:


    is it possible to have optional values in a PHP function?

    some of the built in ones have optional parameters.

    --
    JJ Harrison
    webmastertececo.com
    www.tececo.com
    

    attached mail follows:


    On Friday 26 July 2002 17:46, JJ Harrison wrote: > is it possible to have optional values in a PHP function? > > some of the built in ones have optional parameters.

    Yes, rtfm.

    -- 
    Jason Wong -> Gremlins Associates -> www.gremlins.com.hk
    Open Source Software Systems Integrators
    * Web Design & Hosting * Internet & Intranet Applications Development *
    

    /* O give me a home, Where the buffalo roam, Where the deer and the antelope play, Where seldom is heard A discouraging word, 'Cause what can an antelope say? */

    attached mail follows:


    JJ Harrison wrote:

    >is it possible to have optional values in a PHP function? > >some of the built in ones have optional parameters. > > >-- >JJ Harrison >webmastertececo.com >www.tececo.com > > > > > http://www.php.net/manual/en/functions.arguments.php look at section 'Default argument values'

    René

    attached mail follows:


    I *did* rtfm(or searched it at least).

    That is why I asked the group.

    --
    JJ Harrison
    webmastertececo.com
    www.tececo.com
    

    "Jason Wong" <php-generalgremlins.com.hk> wrote in message news:200207261746.27984.php-generalgremlins.com.hk... > On Friday 26 July 2002 17:46, JJ Harrison wrote: > > is it possible to have optional values in a PHP function? > > > > some of the built in ones have optional parameters. > > Yes, rtfm. > > -- > Jason Wong -> Gremlins Associates -> www.gremlins.com.hk > Open Source Software Systems Integrators > * Web Design & Hosting * Internet & Intranet Applications Development * > > /* > O give me a home, > Where the buffalo roam, > Where the deer and the antelope play, > Where seldom is heard > A discouraging word, > 'Cause what can an antelope say? > */ >

    attached mail follows:


    Hi:

    After validating the login, i am using the header function to call the same page again. The page uses session_start(). But the session variable, namely the login id is not changed. When i refresh the page manually session variable is changed. What is the problem? the header function i use is header(location:"http://PHP_SELF")

    regards kamesh

    _____________ s kameshwaran eEL, Dept of CSA, IISc, Bangalore - 560012 Homepage: http://www2.csa.iisc.ernet.in/~kameshn Phone: +91-80-3942368-111 (Lab), +91-80-3942624 (Hostel: U-95) ____________________________________ Eternity abides in the present.. NOW

    attached mail follows:


    Hello k,

    Friday, July 26, 2002, 10:56:58 AM, you wrote:

    kamesh> Hi:

    kamesh> After validating the login, i am using the header function to call the same kamesh> page again. The page uses session_start(). But the session variable, kamesh> namely the login id is not changed. When i refresh the page manually kamesh> session variable is changed. What is the problem? the header function i kamesh> use is header(location:"http://PHP_SELF")

    first:

    be sure u have register_globals=On, then u have to use header("Location: http://$PHP_SELF")

    if u have register_globals=Off then u need use header("Location: http://$_SERVER['PHP_SELF']")

    -- 
    Best regards,
    Alexander Kuznetsov
    

    attached mail follows:


    Still no good sir. New problem... But I do realised what you mean and now the $xml is now a string before going into the $arguments. When executing script, PHP returns:

    Warning: Sablotron error on line 2: 'arg:/argument.dtd' not found in /home/httpd/html/ctan/resultworkingcopy2.php on line 91 XSLT processing error: 'arg:/argument.dtd' not found

    Refering to the xslt_process line. What does this mean?

    Chia

    -----Original Message----- From: Peter Clarke [mailto:peterjingo.com] Sent: 25 July 2002 16:47 To: ctan Cc: php-generallists.php.net Subject: Re: Applying XSL to XML with PHP

    ctan wrote: > The XML would be something like this... > > <?xml version="1.0" encoding="UTF-8"?> <snip xml>

    Just noticed something... $line = mysql_fetch_array($result, MYSQL_ASSOC); returns an array. Your $arguments array wants a string. So..

    $xml = join($line, ''); $arguments = array('/_xml'=> $xml);

    Peter

    > > Hope this helps... > > chia > > -----Original Message----- > From: Peter Clarke [mailto:peterjingo.com] > Sent: 25 July 2002 13:06 > To: Ctan > Cc: php-generallists.php.net > Subject: Re: Applying XSL to XML with PHP > > > Ctan wrote: > >>I'm trying to apply XSL to XML stored in a MySQL database with PHP. >>How do I go about doing this? I've tried following the example on >>php.net but I seem to run into a lot of trouble. Here's how the code >>looks like (BTW aml is XML stored in the argument Table): >> >> >>if (! empty($searchword )) >> >> $query = "SELECT aml FROM arguments WHERE aml LIKE '%$searchword%'"; >> $result = mysql_query($query) or die ("Query failed"); >> $line = mysql_fetch_array($result, MYSQL_ASSOC); >> >>// Create an array >>$arguments = array('/_xml'=> $line); >> >>//XSL file >>$xsl = "./sheet1.xsl"; >> >>// Create an XSLT processor >>$xslthandler = xslt_create(); >> >>// Perform the transformation >>$html = xslt_process( $xslthandler, 'arg:/_xml', $xsl, NULL, >>$arguments); >> >>// Detect errors >>if (!$html) die ('XSLT processing error: '.xslt_error($xslthandler)); >> >>// Destroy the XSLT processor >>xslt_free($xslthandler); >> >>// Output the resulting HTML >>print $html; >> >> >>What I get on the screen is: >> >> >>Array ( [0] => "With the contents of my variable...") >> >> >>And: >> >> >>Warning: Sablotron error on line 1: XML parser error 2: syntax error >>in /home/httpd/html/ctan/resultworkingcopy2.php on line 93 XSLT >>processing >>error: XML parser error 2: syntax error >> >> >>What gives? I really need to solve this urgent. Thanks... >> >>Chia > > > What is the xml. There may be a content encoding problem or some other > xml issue. > > Peter > > > >

    attached mail follows:


    Hi !

    I am running my PHP application running on apache webserver.I am using Qmail(installed on Linux operating system) as an SMTP server..The problem is..I am not able to send any mails from my application using Qmail.Whereas I am able to send mails from my application using SendMail..My PHP application is running on windows 2000 and the qmail is running on Linux.

    The following is the technical information I am using in my application.....

    A) The mail configuration settings (in php.ini) are.

    1)SMTP = 192.168.10.24 2)sendmail_from = sreedharcssolutionsinc.com 3)sendmail_path = /var/qmail/bin/sendmail

    I tried with the following two options too..that didn't work out..

    sendmail_path = /var/qmail/bin/sendmail sendmail_path = /usr/sbin/sendmail

    B) And I am using php's inbuilt "mail()" function in my application as follows..

    mail("sreedharcssolutionsinc.com","test","test");

    Then when I tried from application I got the following message from Qmail server..

    "See http://pobox.com/~djb/docs/smtplf.html."

    When I have gone to the above link it is saying the following things the qmail expects :

    1) Every line in an Internet mail message is required to end with CR LF. The entire message ends with CR LF dot CR LF. 822bis specifically prohibits other uses of LF.

    2)The mail clients discussed above are incorrectly ending lines with LF and, in most cases, ending the entire message with LF dot LF. That's not CR LF dot CR LF, so a server such as msn.com will sit there waiting for the rest of the message. After a while it'll give up and drop the connection. Your mail doesn't get through.

    Some mail servers convert a bare LF into CR LF, and accept LF dot LF as the end of a mail message.

    I wonder whether the php mail() function handles the mail ...The format qmail is expecting.

    I just want to know why the mails are not going through "qmail" from my application where as my application is able to send mail using "sendmail" with the above settings..

    I appreciate your help regarding this problem..

    Regards ! Sreedhar.

    attached mail follows:


    Howdy all!

    Just wanted to remind everyone that sign-up for the PHP Meetup is still in progress at http://php.meetup.com . At latest count there are 289 folks signed up world-wide with the top 10 cities being;

    Washington DC (9 members) Toronto (9 members) Leeds, UK (8 members) London, England (8 members) Amsterdam (7 members) Melbourne (6 members) Atlanta (5 members) Oakland-Alameda, CA (5 members) Manhattan (below 42nd St) (5 members) Montréal (4 members)

    Why do something like this? Meet other developers, networking (you can never tell when you're going to need another pair of hands for a project), networking (you can never tell when someone is going to need to hire extra hands for a project), and networking (you get the idea). Sign up soon! There are thousands of PHP folks out there, spread the word.

    On another note ....

    TEXAS PHP Users! php.meetup stats ...

    Dallas, TX (2 members) Austin, TX (2 members) San Antonio, TX (2 members) Bryan-College Station, TX (2 members) Longview-Marshall, TX (1 members)

    I would like to determine interest in having a PHP Mini-Conference in Texas, perhaps in the January - April time frame. Due to some contacts that I have I can get us discount rates at the T Bar M Tennis & Conference Center in New Braunfels, with a meal package, and other non-PHP activities. There are many golf courses in the area, T Bar M offers high and low rope course instruction, there's tennis, water sports, close proximity to San Antonio, The Hill Country, Gruene (where the oldest dance hall in Texas features tons of stars as well as up-and-comers!), and much more.

    You do not have to live in Texas to want to attend. Heck, you don't even have to be a PHP developer, IT Managers who want to find out why PHP is good for them, folks who have an interest in PHP but haven't taken the firt step, or other computer types who just want to hang out with other computer types.

    We could have a program of paper presentations, or it could be more of a social/networking event. Heck, maybe someone such as an author or part of the Zend group would be a guest speaker. There are many possibilities. Send your thoughts on this to me directly at jay.blanchardniicommunications.com. If you know of other PHP developers who are not on any of the lists here, please forward this information to them if you think that they would be interested.

    I look forward to your responses...

    Jay

    attached mail follows:


    I'm getting this error when I try to configure php for install. Where can I download lex. I'm using gcc 3.1

    __________________________________________________ Do You Yahoo!? Yahoo! Health - Feel better, live better http://health.yahoo.com

    attached mail follows:


    Hello Daniel,

    Friday, July 26, 2002, 3:44:04 PM, you wrote:

    DG> I'm getting this error when I try to configure php for DG> install. DG> Where can I download lex. DG> I'm using gcc 3.1

    http://www.rpmfind.net/linux/rpm2html/search.php?query=lex

    Just type your OS name and hit search. You will find rpms for flex. Lex and flex - are almost the same.

    P.S. When I had the same problem PHP wanted to me install bison not only lex 8)

    -- 
    Best regards,
    Alexander Kuznetsov
    

    attached mail follows:


    I'm doing a class that actually interfaces with a mysql database, so far i can easily get the type out the values, the names of fields, everything i need is there except one thing..

    How can i check if a field has auto-increment extra activated on it?

    Thanks

    attached mail follows:


    Oh, and also, i need to know how to get the default value...

    Btw, i CAN be done, or else, how does phpMyAdmin does it =P

    InsaneCoder

    > > How can i check if a field has auto-increment extra activated on it? > > Thanks > >

    attached mail follows:


    [snip] Oh, and also, i need to know how to get the default value...

    Btw, i CAN be done, or else, how does phpMyAdmin does it =P

    InsaneCoder [/snip]

    Hey Insane!

    Have you looked at the code for phpmyadmin? I was looking around in it the other day to find out about a couple of features and the code is pretty clear. Just a thought ...

    The other thing to do is to use a DESCRIBE TABLE query and then look at the array returned.

    HTH!

    Jay

    "Other than that, Mrs. Lincoln, how was the play?"

    ************************************* * Want to meet other PHP developers * * in your area? Check out: * * http://php.meetup.com/ * * No developer is an island ... * *************************************

    attached mail follows:


    ok tahnks, anyway, while i was looking at the php help manual i found mysql_field_flags which solves my auto-inc problem, but not the default value anyway, THX

    insane

    "Jay Blanchard" <jay.blanchardniicommunications.com> wrote in message news:001001c234a3$e8d1c390$8102a8c0niigziuo4ohhdt... > [snip] > Oh, and also, i need to know how to get the default value... > > Btw, i CAN be done, or else, how does phpMyAdmin does it =P > > InsaneCoder > [/snip] > > Hey Insane! > > Have you looked at the code for phpmyadmin? I was looking around in it the > other day to find out about a couple of features and the code is pretty > clear. Just a thought ... > > The other thing to do is to use a DESCRIBE TABLE query and then look at the > array returned. > > HTH! > > Jay > > "Other than that, Mrs. Lincoln, how was the play?" > > ************************************* > * Want to meet other PHP developers * > * in your area? Check out: * > * http://php.meetup.com/ * > * No developer is an island ... * > ************************************* > >

    attached mail follows:


    [snip] ok tahnks, anyway, while i was looking at the php help manual i found mysql_field_flags which solves my auto-inc problem, but not the default value anyway, THX [/snip]

    Go with describe table, a sample; mysql> describe tblCDR; +----------------+-------------+------+-----+---------+----------------+ | Field | Type | Null | Key | Default | Extra | +----------------+-------------+------+-----+---------+----------------+ | id | int(11) | | PRI | NULL | auto_increment |

    The default value in this case is NULL

    HTH!

    Jay

    Of course I don’t look busy…I did it right the first time

    ************************************* * Want to meet other PHP developers * * in your area? Check out: * * http://php.meetup.com/ * * No developer is an island ... * *************************************

    attached mail follows:


    I am looking for a function wich can deliver me an array with the days of a specific week. The function should recieve $year and $weeknumber and return $day[0]..$day[6].

    f.i.: $year = '2002' and $weeknumber = '31' -> $day[0] = '28-07-2002' $day[1] = '29-07-2002' $day[2] = '30-07-2002' $day[3] = '31-07-2002' $day[4] = '01-08-2002' $day[5] = '02-08-2002' $day[6] = '03-08-2002'

    Who can help me out?

    --
    Rainer Schreiber      [consulent]
    Instituut Maidenhead / Hairplus
    Hoekersingel 22
    3028 XM  Rotterdam
    

    Tel. 010-462.30.11 Fax. 010-462.33.70 E-mail. rainer.schreiberhairplus.nl

    attached mail follows:


    <?

    function retdays($year, $weekn) { $ar = array(); $weekn--; // adjust weeknumber (passed usually as 1 based but zero based is needed for calculations) // get base date $d = mktime ( 0, 0, 0, 1, 1, $year) + (3600 * 24 * 7 * $weekn) - 3600 * 24 * 2; for ($i=0;$i<7;$i++) { $d = $d + (3600*24); $ar[] = strftime ("%m/%d/%Y" , $d); } return $ar; }

    $d = retdays(2002, 5); var_dump($d); ?>

    did not yield same results as you posted, but it worked fine for the first 5,6 weeks.

    keep me posted,

    //elias

    "Rainer Schreiber" <rainer.schreiberhairplus.nl> wrote in message news:20020726125453.80037.qmailpb1.pair.com... > I am looking for a function wich can deliver me an array with the days of a > specific week. > The function should recieve $year and $weeknumber and return > $day[0]..$day[6]. > > f.i.: $year = '2002' and $weeknumber = '31' -> > $day[0] = '28-07-2002' > $day[1] = '29-07-2002' > $day[2] = '30-07-2002' > $day[3] = '31-07-2002' > $day[4] = '01-08-2002' > $day[5] = '02-08-2002' > $day[6] = '03-08-2002' > > Who can help me out? > > > -- > Rainer Schreiber [consulent] > Instituut Maidenhead / Hairplus > Hoekersingel 22 > 3028 XM Rotterdam > > Tel. 010-462.30.11 > Fax. 010-462.33.70 > E-mail. rainer.schreiberhairplus.nl > > >

    attached mail follows:


    I know that i can retrieve records 1-24 in my db with a select statement like SELECT whatever FROM tablename ORDER BY id ASC LIMIT 23, but how can I get records 25 to 50 if I have 100 records in my DB?

    _________________________________________________________________ Send and receive Hotmail on your mobile device: http://mobile.msn.com

    attached mail follows:


    Try SELECT whatever FROM tablename ORDER BY id ASC LIMIT 25,25

    Paul

    -----Original Message----- From: Tyler Durdin [mailto:linuxgeek23hotmail.com] Sent: 26 July 2002 13:58 To: php-generallists.php.net Subject: [PHP] selcet statement question

    I know that i can retrieve records 1-24 in my db with a select statement like SELECT whatever FROM tablename ORDER BY id ASC LIMIT 23, but how can I get records 25 to 50 if I have 100 records in my DB?

    _________________________________________________________________ Send and receive Hotmail on your mobile device: http://mobile.msn.com

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

    attached mail follows:


    Read the documentation for your database -- with some you can't, others you can. Miles Thompson

    At 12:57 PM 7/26/2002 +0000, Tyler Durdin wrote: >I know that i can retrieve records 1-24 in my db with a select statement >like SELECT whatever FROM tablename ORDER BY id ASC LIMIT 23, but how can >I get records 25 to 50 if I have 100 records in my DB? > > > >_________________________________________________________________ >Send and receive Hotmail on your mobile device: http://mobile.msn.com > > >-- >PHP General Mailing List (http://www.php.net/) >To unsubscribe, visit: http://www.php.net/unsub.php

    attached mail follows:


    [snip] I know that i can retrieve records 1-24 in my db with a select statement like SELECT whatever FROM tablename ORDER BY id ASC LIMIT 23, but how can I get records 25 to 50 if I have 100 records in my DB? [/snip]

    Different DB's have differing ways of doing this, like MySQL;

    SELECT * FROM foo ORDER BY id ASC LIMIT 0, 24 ****** first 25 records

    SELECT * FROM foo ORDER BY id ASC LIMIT 25, 24 ***** next 25 records

    Don't forget that the row numbering starts with 0.

    HTH!

    Jay

    "Oh, sure…but what’s the speed of DARK?"

    ************************************* * Want to meet other PHP developers * * in your area? Check out: * * http://php.meetup.com/ * * No developer is an island ... * *************************************