php-general Digest 14 Jan 2008 07:00:27 -0000 Issue 5234

Topics (messages 267184 through 267206):

Re: var_dump() results
        267184 by: Jochem Maas
        267185 by: Europus
        267186 by: Steve Edberg
        267187 by: T.Lensselink
        267188 by: Europus
        267189 by: Europus
        267205 by: Chris
        267206 by: Jim Lucas

DESC order results
        267190 by: Danny Brow
        267191 by: Jochem Maas
        267192 by: Danny Brow
        267193 by: Larry Garfield
        267195 by: Silvio Porcellana

Re: uh oh, I defined a resoruce
        267194 by: Jochem Maas
        267204 by: Sancar Saran

anaylyze email
        267196 by: Yui Hiroaki
        267197 by: Manuel Lemos

Re: Guestbook
        267198 by: Andrés Robinet
        267199 by: Børge Holen

$_GET and multiple spaces.
        267200 by: Churchill, Craig
        267203 by: Al

Re: A good book for a perspective programer.
        267201 by: Sean-Michael
        267202 by: David Powers

Administrivia:

To subscribe to the digest, e-mail:
        [EMAIL PROTECTED]

To unsubscribe from the digest, e-mail:
        [EMAIL PROTECTED]

To post to the list, e-mail:
        [EMAIL PROTECTED]


----------------------------------------------------------------------
--- Begin Message ---
Europus schreef:
It's pretty much the same. With var_dump(), values from the first row
of the table are iterated twice, the script is not looping through and
reporting all 2100 rows. Grossly similar behavior was observed with
print_r() and echo: while different data was reported by each, the
loop wouldn't loop. The first row was reported once (or twice) and
that was the end of that. I've tried foreach() also, same-same. It
doesn't loop, it just reports the first row.

Here's my code:

side note: where does $table come from?


<?php

//connect to db
$link = mysql_pconnect('$host', '$login', '$passwd');
if (!$link) {
    die('Unable to connect : ' . mysql_error());
}
// make $table the current db
$db_selected = mysql_select_db('$table', $link);
if (!$db_selected) {
    die ('Unable to select $table : ' . mysql_error());
}

//get column data
    $sql    = "SELECT column2, column3 FROM $table";
    $result = mysql_query($sql);

if (!$result) {
        echo "query failed.\n";
} else {
        while ($row = mysql_fetch_array($result))
                var_dump($row);
}       


    $row = mysql_fetch_row($result);

//loop through to display results
for($i=0; $i < count($row); $i++){
    var_dump($row);
    echo "<br /><br />";
?>

Ulex


--- End Message ---
--- Begin Message ---
T.Lensselink wrote:

Can you show some code?

Apparently I sent replies to T.Lensselink only, here's the meat of
the 2nd one:

--

Actually, it doesn't exactly iterate the 1st row 4 times, it's a bit
more convoluted.

The table fas 4 columns (Fields):
1 - int, primary, auto-incrementer
2 - varchar() values
3 - varchar() values
4 - varchar() values

and 2100 rows. I'm after the data in the 2nd and 3rd columns. The
return is 4 rows of this:

array(4) {
[0]=> string(11) "col_2_row_1_data" ["col_2"]=> string(11) "col_2_row_1_data" [1]=> string(13) "col_3_row_1_data" ["col_3"]=> string(13) "col_3_row_1_data" }

This is way beyond my ken, but I want to learn so I'll keep plugging
at it. Tips & suggestions are welcome....

Ulex

--- End Message ---
--- Begin Message ---
At 12:32 PM -0500 1/13/08, Europus wrote:
It's pretty much the same. With var_dump(), values from the first row
of the table are iterated twice, the script is not looping through and
reporting all 2100 rows. Grossly similar behavior was observed with
print_r() and echo: while different data was reported by each, the
loop wouldn't loop. The first row was reported once (or twice) and
that was the end of that. I've tried foreach() also, same-same. It
doesn't loop, it just reports the first row.

Here's my code:

<?php

//connect to db
$link = mysql_pconnect('$host', '$login', '$passwd');
if (!$link) {
    die('Unable to connect : ' . mysql_error());
}
// make $table the current db
$db_selected = mysql_select_db('$table', $link);
if (!$db_selected) {
    die ('Unable to select $table : ' . mysql_error());
}

//get column data
        $sql    = "SELECT column2, column3 FROM $table";
        $result = mysql_query($sql);
        $row = mysql_fetch_row($result);

//loop through to display results
for($i=0; $i < count($row); $i++){
        var_dump($row);
        echo "<br /><br />";
?>

Ulex


As far as displaying only the first row, that's because you're only fetching the first row; count($row) in your for loop will always evaluate to 0 (if there are no results) or 1. You need to move the mysql_fetch_row() call into your loop; something like

        $result = mysql_query($sql);
        while ($row = mysql_fetch_row($result)) {
                var_dump($row);
                ...
        }

or you could do

        $result = mysql_query($sql);
        $count = mysql_num_rows($result);
        for ($i=0; $i<$count; $i++) {
                var_dump($row);
                ...
        }

As far as displaying the results twice, I'm not sure; that resembles the behavior of mysql_fetch_array() -

        http://us.php.net/manual/en/function.mysql-fetch-array.php

- where the default is to return data as both an associative and numerically-indexed array. I'm guessing that the above code isn't an exact cut-and-paste, as using single quotes (eg, mysql_pconnect('$host', '$login', '$passwd') does not interpolate variables, so that line will not work unless your username is actually '$login', etc. Which it probably isn't. Are you sure the real code isn't using mysql_fetch_array() instead of mysql_fetch_row()?

        steve


--
+--------------- my people are the people of the dessert, ---------------+
| Steve Edberg                                http://pgfsun.ucdavis.edu/ |
| UC Davis Genome Center                            [EMAIL PROTECTED] |
| Bioinformatics programming/database/sysadmin             (530)754-9127 |
+---------------- said t e lawrence, picking up his fork ----------------+

--- End Message ---
--- Begin Message ---
Europus wrote:
Actually, it doesn't exactly iterate the 1st row 4 times, it's a bit
more convoluted.

The table as 4 columns:
1 - int, primary, auto-incrementer
2 - varchar() values
3 - varchar() values
4 - varchar() values

and 2100 rows. The return is 4 rows of this:

array(4) {
[0]=> string(11) "col_1_row_1_data" ["col_1"]=> string(11) "col_1_row_1_data" [1]=> string(13) "col_2_row_1_data" ["col_2"]=> string(13) "col_2_row_1_data" }

This is way beyond my ken, but I want to learn so I'll keep plugging
at it. Tips & suggestions are welcome....

Ulex

Yes well looking at the starting code i realise i forgot something. Sorry for that.
When doing mysql_fetch_array or mysql_fetch_row you get only one row.
So what you want to do is loop through the result set:

$result = mysql_query($sql);

//loop through to display results
while ($row = mysql_fetch_array($result)) {
   var_dump($row);
   echo "<br /><br />";
}

P.s. Please reply to the list also :)

--- End Message ---
--- Begin Message ---
Jochem Maas wrote:

side note: where does $table come from?

I didn't want to reveal the real names of my server/host, table,
login or password to the list, so I tried setting $host, $login,
$passwd, and $table variables at the top of the script. That way
it's 4 lines to omit when posting code, instead of parsing through
to edit each instance. That didn't work so I've since restored the
initial values, probably I stepped on a reserved word. I'll check
on that, I like the idea of setting those to variables elsewhere.

//get column data
    $sql    = "SELECT column2, column3 FROM $table";
    $result = mysql_query($sql);

if (!$result) {
    echo "query failed.\n";
} else {
    while ($row = mysql_fetch_array($result))
        var_dump($row);
}

    $row = mysql_fetch_row($result);

Now that, that change makes what looks to be 2100 rows of data flood
the screen, thank you. Now I can move on to processing that data
in the next step of my script.

It looks like, my take-away lesson is that I was invoking var_dump()
too late, I should have been performing that check right after running
mysql_fetch_array(), because later operations step on the data and
that's why I was getting unexpected returns.

Ulex

--- End Message ---
--- Begin Message ---
Steve Edberg wrote:

As far as displaying only the first row, that's because you're only fetching the first row; count($row) in your for loop will always evaluate to 0 (if there are no results) or 1. You need to move the mysql_fetch_row() call into your loop; something like

    $result = mysql_query($sql);
    while ($row = mysql_fetch_row($result)) {
        var_dump($row);
        ...
    }

or you could do

    $result = mysql_query($sql);
    $count = mysql_num_rows($result);
    for ($i=0; $i<$count; $i++) {
        var_dump($row);
        ...
    }

Noted, thank you. I'll play with these too, to see what I think of them.

As far as displaying the results twice, I'm not sure; that resembles the behavior of mysql_fetch_array() -

The script had ~fetch_array() initially, I couldn't get it to work as
expected so I changed it to ~fetch_row(). Now it's back to ~fetch_array()

Both as a learning exercise and as an end-goal, I'm rewriting some
code so that it does what I want it to, not what it imperfectly does
according to the original programmers intent. That original intent
bears only passing resemblance to what was requested of that programmer,
it's become a sore subject.

    http://us.php.net/manual/en/function.mysql-fetch-array.php

- where the default is to return data as both an associative and numerically-indexed array.

That explains some things. And I have some reading and experimenting
to do before I move on to the next step in the script.

I'm guessing that the above code isn't an exact cut-and-paste, as using single quotes (eg, mysql_pconnect('$host', '$login', '$passwd') does not interpolate variables, so that line will not work unless your username is actually '$login', etc. Which it probably isn't.

Correct. That was my attempt to obfuscate some of my real data, the
username and password especially. See my other post on this.

Ulex

--- End Message ---
--- Begin Message ---

<picky>

or you could do

    $result = mysql_query($sql);
    $count = mysql_num_rows($result);
    for ($i=0; $i<$count; $i++) {
        var_dump($row);
        ...
    }

Not unless you have a

$row = mysql_fetch_assoc($result);

before doing the var_dump of $row because $row isn't being set :)

</picky>

--
Postgresql & php tutorials
http://www.designmagick.com/

--- End Message ---
--- Begin Message ---
Europus wrote:
Jochem Maas wrote:

side note: where does $table come from?

I didn't want to reveal the real names of my server/host, table,
login or password to the list, so I tried setting $host, $login,
$passwd, and $table variables at the top of the script. That way
it's 4 lines to omit when posting code, instead of parsing through
to edit each instance. That didn't work so I've since restored the
initial values, probably I stepped on a reserved word. I'll check
on that, I like the idea of setting those to variables elsewhere.

The reason your variables didn't work was that you had them enclosed in single quotes. Within single quotes, no variables are parsed. Two options to fix this. Use double quotes, or get rid of the quotes completely since you are using variables. The latter suggestion is probably the most preferred way of working with variables.

here is the code from your original email. I have modified it to work like one would expect it too.

<?php

# note:
# don't use *_pconnect().  I have found it to be a resource hog
# Remove single quotes around variables
# notice the or at the end of the first line
//connect to db
$link = mysql_connect($host, $login, $passwd) or
                die('Unable to connect : ' . mysql_error());

# note
# When working with boolean results & if conditions, just put the call
# in the if condition
# Remove single quotes around $table variable
# notice the or at the end of the first line
# I used curly brackets around my variable, just so the PHP parse will
# never get confused.
// make $table the current db
mysql_select_db($table, $link) or
        die ("Unable to select {$table}: " . mysql_error());

# I used curly brackets around my variable, just so the PHP parse will
# never get confused.
//get column data
$sql    = "SELECT column2, column3 FROM {$table}";


# notice the or at the end of the first line
$result = mysql_query($sql) or
        die('SQL Query Error['.mysql_errno($link).'] '.
                                mysql_error($link));

# I have always like using while loops with my db retrieving, just seems
# to me to work better
# Keep looping through the result set, until mysql_fetch_assoc() returns
# false.  Once it returns false, the while loop will exit.
# Change to using *_fetch_assoc() this way it will only return to me the
# column named variables from the result set row.  Not the indexed names
//loop through to display results
while ( $row = mysql_fetch_assoc($result) ) {
        echo '<br /><br />'.print_r($row, 1);
}

?>

Give this a try and see what happens. Should do everything you want it to do and maybe more.

Jim


//get column data
    $sql    = "SELECT column2, column3 FROM $table";
    $result = mysql_query($sql);

if (!$result) {
    echo "query failed.\n";
} else {
    while ($row = mysql_fetch_array($result))
        var_dump($row);
}
    $row = mysql_fetch_row($result);

Now that, that change makes what looks to be 2100 rows of data flood
the screen, thank you. Now I can move on to processing that data
in the next step of my script.

It looks like, my take-away lesson is that I was invoking var_dump()
too late, I should have been performing that check right after running
mysql_fetch_array(), because later operations step on the data and
that's why I was getting unexpected returns.

Ulex


--- End Message ---
--- Begin Message ---
Just wondering if anyone could tell me how reliable the DESC order
option is going to be when I am parsing thousands of records where they
are multiple ChartNo's for the same clientNo. Or is there a better way
to grab the most recent ChartNo.

$link = mysql_connect('localhost', 'myuser', 'mypassword') or die('Could
not connect: ' . mysql());

mysql_select_db('mydatabase') or die('Could not select database');

$query = 'SELECT * FROM eChart WHERE clientNo = "2" ORDER BY ChartNo
DESC';

$result = mysql_query($query) or die('Query failed: ' . mysql_error());

$line = mysql_fetch_array($result, MYSQL_ASSOC);


// Just for testing....
print mysql_num_rows($result);



Thanks,
Dan




-- 
This message has been scanned for viruses and
dangerous content by MailScanner, and is
believed to be clean.

--- End Message ---
--- Begin Message ---
Danny Brow schreef:
Just wondering if anyone could tell me how reliable the DESC order
option is going to be when I am parsing thousands of records where they
are multiple ChartNo's for the same clientNo. Or is there a better way
to grab the most recent ChartNo.

this is a mysql question not a php question, please try to ask questions
in the appropriate forum.

the reliability of 'ORDER BY' is not tied to the ammount of
records returned.

given that you only want the 'most recent'
(by which I assume you mean the 'highest value') ChartNo for
a given clientNo you should be performing a query that returns a
single row of data.

also you shouldn't be quoting values pertaining to numeric fields
(I assume clientNo is an integer)

1. assuming ChartNo is numeric:

SELECT MAX(ChartNo) as chartno FROM eChart WHERE clientNo=2

2. assuming ChartNo is a varchar (or similar):

SELECT ChartNo FROM eChart WHERE clientNo=2 ORDER BY ChartNo DESC LIMIT 0,1


$link = mysql_connect('localhost', 'myuser', 'mypassword') or die('Could
not connect: ' . mysql());

mysql_select_db('mydatabase') or die('Could not select database');

$query = 'SELECT * FROM eChart WHERE clientNo = "2" ORDER BY ChartNo
DESC';

$result = mysql_query($query) or die('Query failed: ' . mysql_error());

$line = mysql_fetch_array($result, MYSQL_ASSOC);


// Just for testing....
print mysql_num_rows($result);



Thanks,
Dan





--- End Message ---
--- Begin Message ---
Thanks for the answer, didn't think of asking this in a MySQL forum,
sorry.

Dan

On Sun, 2008-01-13 at 20:28 +0100, Jochem Maas wrote:
> Danny Brow schreef:
> > Just wondering if anyone could tell me how reliable the DESC order
> > option is going to be when I am parsing thousands of records where they
> > are multiple ChartNo's for the same clientNo. Or is there a better way
> > to grab the most recent ChartNo.
> 
> this is a mysql question not a php question, please try to ask questions
> in the appropriate forum.
> 
> the reliability of 'ORDER BY' is not tied to the ammount of
> records returned.
> 
> given that you only want the 'most recent'
> (by which I assume you mean the 'highest value') ChartNo for
> a given clientNo you should be performing a query that returns a
> single row of data.
> 
> also you shouldn't be quoting values pertaining to numeric fields
> (I assume clientNo is an integer)
> 
> 1. assuming ChartNo is numeric:
> 
> SELECT MAX(ChartNo) as chartno FROM eChart WHERE clientNo=2
> 
> 2. assuming ChartNo is a varchar (or similar):
> 
> SELECT ChartNo FROM eChart WHERE clientNo=2 ORDER BY ChartNo DESC LIMIT 0,1
> 
> > 
> > $link = mysql_connect('localhost', 'myuser', 'mypassword') or die('Could
> > not connect: ' . mysql());
> > 
> > mysql_select_db('mydatabase') or die('Could not select database');
> > 
> > $query = 'SELECT * FROM eChart WHERE clientNo = "2" ORDER BY ChartNo
> > DESC';
> > 
> > $result = mysql_query($query) or die('Query failed: ' . mysql_error());
> > 
> > $line = mysql_fetch_array($result, MYSQL_ASSOC);
> > 
> > 
> > // Just for testing....
> > print mysql_num_rows($result);
> > 
> > 
> > 
> > Thanks,
> > Dan
> > 
> > 
> > 
> > 
> 
> -- 
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
> 
> 


-- 
This message has been scanned for viruses and
dangerous content by MailScanner, and is
believed to be clean.

--- End Message ---
--- Begin Message ---
This is a MySQL question, not a PHP question.  That said, what you want is the 
LIMIT keyword.  

On Sunday 13 January 2008, Danny Brow wrote:
> Just wondering if anyone could tell me how reliable the DESC order
> option is going to be when I am parsing thousands of records where they
> are multiple ChartNo's for the same clientNo. Or is there a better way
> to grab the most recent ChartNo.
>
> $link = mysql_connect('localhost', 'myuser', 'mypassword') or die('Could
> not connect: ' . mysql());
>
> mysql_select_db('mydatabase') or die('Could not select database');
>
> $query = 'SELECT * FROM eChart WHERE clientNo = "2" ORDER BY ChartNo
> DESC';
>
> $result = mysql_query($query) or die('Query failed: ' . mysql_error());
>
> $line = mysql_fetch_array($result, MYSQL_ASSOC);
>
>
> // Just for testing....
> print mysql_num_rows($result);
>
>
>
> Thanks,
> Dan
>
>
>
>
> --
> This message has been scanned for viruses and
> dangerous content by MailScanner, and is
> believed to be clean.


-- 
Larry Garfield                  AIM: LOLG42
[EMAIL PROTECTED]               ICQ: 6817012

"If nature has made any one thing less susceptible than all others of 
exclusive property, it is the action of the thinking power called an idea, 
which an individual may exclusively possess as long as he keeps it to 
himself; but the moment it is divulged, it forces itself into the possession 
of every one, and the receiver cannot dispossess himself of it."  -- Thomas 
Jefferson

--- End Message ---
--- Begin Message ---

$query = 'SELECT * FROM eChart WHERE clientNo = "2" ORDER BY ChartNo
DESC';


If you want just one record:

$query = 'SELECT * FROM eChart WHERE clientNo = "2" ORDER BY ChartNo DESC LIMIT 0, 1';


BTW, you'd better ask the MySQL mlist: http://lists.mysql.com/

HTH, cheers
Silvio

--- End Message ---
--- Begin Message ---
Sancar Saran schreef:
On Sunday 13 January 2008 16:53:42 Jochem Maas wrote:
Sancar Saran schreef:
Well,

ADODB and TYPO3 are  successfull oss procjecs which uses PHP and they
utilizes globals at large.
windows is a successful OS but most people would agree it's built on a
foundation of cruft.

success != built with good code != globals are good practice.

Regards.

Sancar

Hello there,
After some research, I found source of the "Globals are evil".

This was coming from common c and c++ practice. In this enviroments using globals leding to race conditions which was very hard to resolve.

so? this has nothing to do with the reasoning about php globals being evil.


and uh oh, that php thing was using share nothing perspective. No race condtions.

no race conditions occur in code written in php? true that there is
no direct race conditions that can occur as a direct result of running code
but obviously you've never dealt with multi-user systems using a databse 
backend,
or file-writing based tools used in a web-environment (e.g. template output 
caching)
or anything that uses shared memory or trying to guanrantee that a command-line 
script
runs as a singleton. to name but a few examples that can most definitely be 
prone
to race-conditions.

oh and I believe you meant 'share nothing architecture'

except variable crashing.

I think you just made up 'variable crashing' - at any rate it not a concept
I understand to mean anything specific to the issue we are talking about.


From my point of view. After 8 years of php programming only one time face the variable crashing. And that was a local variable called $i.

well that seals it then - obviously globals are fantastic?!?

not to mention that this does not include any number of globals related
errors lurking in code[pathes] that is yet to be run or tested or errors that 
other
people have encountered in your code but that you know nothing about.


Of course your millage was vary...

it does, depending on how early or late I decide to change gear, the ammount of
traffic on the road, road-surface temperature, humidity, altitude, 
tyre-pressure,
octane number of the fuel I'm using and any number of other variables.

which is another way of saying - your mileage will vary.

--- End Message ---
--- Begin Message ---
On Sunday 13 January 2008 21:42:28 Jochem Maas wrote:
>
> no race conditions occur in code written in php? true that there is
> no direct race conditions that can occur as a direct result of running code
> but obviously you've never dealt with multi-user systems using a databse
> backend, or file-writing based tools used in a web-environment (e.g.
> template output caching) or anything that uses shared memory or trying to
> guanrantee that a command-line script runs as a singleton. to name but a
> few examples that can most definitely be prone to race-conditions.
>

Hmmm interesting so you mean 

$GLOBALS['language'] = memcached->get('language');

race condition prone  than

function hede() {
global $language

$language = memcached->get('language');

}

Regards

Sancar

--- End Message ---
--- Begin Message ---
Thank you for your response.

I try to write a code.

I actualy want to do;

1) some body send email to me; for example; to [EMAIL PROTECTED] from [EMAIL 
PROTECTED]
2)read it's email
3)return to [EMAIL PROTECTED]

so I can not do this 2)

I try to read pop3. I can not find any example!

Regards,
Yui

--- End Message ---
--- Begin Message ---
Hello,

on 01/13/2008 07:46 PM Yui Hiroaki said the following:
> Thank you for your response.
> 
> I try to write a code.
> 
> I actualy want to do;
> 
> 1) some body send email to me; for example; to [EMAIL PROTECTED] from [EMAIL 
> PROTECTED]
> 2)read it's email
> 3)return to [EMAIL PROTECTED]
> 
> so I can not do this 2)
> 
> I try to read pop3. I can not find any example!

You can use the MIME parser package. It can be used to parse whole
messages including extracting e-mail addresses from the headers.

But if you have already the From address header value, you can use the
RFC822 address parser class which can extract the e-mail addresses and
any names associated to the names.

It also has some tolerance to malformed addresses, so it can parse
addresses in messages that are not correctly formatted according to the
e-mail standards.

Take a look in particular at the test_message_decoder.php and
test_parse_addresses.php example scripts.

http://www.phpclasses.org/mimeparser


-- 

Regards,
Manuel Lemos

PHP professionals looking for PHP jobs
http://www.phpclasses.org/professionals/

PHP Classes - Free ready to use OOP components written in PHP
http://www.phpclasses.org/

--- End Message ---
--- Begin Message ---
> -----Original Message-----
> From: Børge Holen [mailto:[EMAIL PROTECTED]
> Sent: Sunday, January 13, 2008 7:48 AM
> To: [EMAIL PROTECTED]
> Subject: Re: [PHP] Guestbook
> 
> On Sunday 13 January 2008 01:32:53 Andrés Robinet wrote:
> > Hi Guys,
> >
> > Anybody knows of a free and decent PHP Multilanguage guestbook (or at
> least
> > supporting German and English)? I don't care if it is db-driven or
> uses
> > flat files.
> > I know how to write one, but it's for a website we didn't develop
> (but will
> > now host) and I'm feeling a bit lazy... maybe someone has a hint.
> > I don't care of how it looks, I can customize that, just want to
> write as
> > less code as possible and avoid any security headaches as well
> (yeah... the
> > good old lazy days :)).
> 
> jup feeling lazy alright. Good thing google works

Good... that will be my answer next time I don't have anything to say on a
thread.

And yeah... you can search for "Free PHP <whatever>" and you'll get some
Ad-Oriented websites if you know what I mean... sometimes Google just sucks.

And sometimes "Yes, once I used XXXX which is reliable, simple and supports
German..." is not that hard to answer. If for every issue you come across
you have to use Google alone, then get rid of the list... there were so many
jerky questions that got answered here... Anyway, I'll just have to write my
own and save it on our library, there's a German speaking woman in the
company which will give me a hand. I personally hate guestbooks, but I
prefer to have some reusable piece of our own, than to have to deal with
some dirty code for which I don't have a recommendation.

Pity, it is the first time I ask something to the list, I expected just a
bit more (like a couple of names to research).
Well... seems that I'll change my policy a bit next time someone needs a
hand.

Rob

> 
> 
> >
> > Thanks in advance,
> >
> > Rob
> >
> > ndrés Robinet | Lead Developer | BESTPLACE CORPORATION
> > 5100 Bayview Drive 206, Royal Lauderdale Landings, Fort Lauderdale,
> FL
> > 33308
> >
> > | TEL 954-607-4207 | FAX 954-337-2695
> >
> > Email: [EMAIL PROTECTED]  | MSN Chat: [EMAIL PROTECTED]  |  SKYPE:
> > bestplace |  Web: http://www.bestplace.biz | Web: http://www.seo-
> diy.com
> 
> 
> 
> --
> ---
> Børge Holen
> http://www.arivene.net

--- End Message ---
--- Begin Message ---
On Monday 14 January 2008 00:07:30 Andrés Robinet wrote:
> > -----Original Message-----
> > From: Børge Holen [mailto:[EMAIL PROTECTED]
> > Sent: Sunday, January 13, 2008 7:48 AM
> > To: [EMAIL PROTECTED]
> > Subject: Re: [PHP] Guestbook
> >
> > On Sunday 13 January 2008 01:32:53 Andrés Robinet wrote:
> > > Hi Guys,
> > >
> > > Anybody knows of a free and decent PHP Multilanguage guestbook (or at
> >
> > least
> >
> > > supporting German and English)? I don't care if it is db-driven or
> >
> > uses
> >
> > > flat files.
> > > I know how to write one, but it's for a website we didn't develop
> >
> > (but will
> >
> > > now host) and I'm feeling a bit lazy... maybe someone has a hint.
> > > I don't care of how it looks, I can customize that, just want to
> >
> > write as
> >
> > > less code as possible and avoid any security headaches as well
> >
> > (yeah... the
> >
> > > good old lazy days :)).
> >
> > jup feeling lazy alright. Good thing google works
>
> Good... that will be my answer next time I don't have anything to say on a
> thread.

ok, THAT was informative.

>
> And yeah... you can search for "Free PHP <whatever>" and you'll get some
> Ad-Oriented websites if you know what I mean... sometimes Google just
> sucks.

I don't care, don't use google.

>
> And sometimes "Yes, once I used XXXX which is reliable, simple and supports
> German..." is not that hard to answer.

You don't even have a suggestion, and still complain

> If for every issue you come across 
> you have to use Google alone, then get rid of the list... there were so
> many jerky questions that got answered here... 

This list is "about" php, ie what you build ... lets say guestbooks of. Jerky 
or not, this is where you come when you hit a brickwall, with no lazyness

> Anyway, I'll just have to 
> write my own and save it on our library, there's a German speaking woman in
> the company which will give me a hand.

See there you go... and with some help you should be down on 30min each.

> I personally hate guestbooks, 

me to, especially those with captcha

> but I  
> prefer to have some reusable piece of our own, than to have to deal with
> some dirty code for which I don't have a recommendation.

Join the club

>
> Pity, it is the first time I ask something to the list, I expected just a
> bit more (like a couple of names to research).

Did you do any research before askin' for help? sure didn't sound like it.
Remember that some (most?) of these guys (and gals?) do php for a living, and 
take it out of their own pocket trying to help one'another, and it's a rude 
practice demanding without showing you'd done some forehand homework.
Me? I'm just rude enought to point that out.

> Well... seems that I'll change my policy a bit next time someone needs a
> hand.

I hope you catch on to both my irony and what I try to tell you, if so you'd 
be doin' just fine

>
> Rob
>
> > > Thanks in advance,
> > >
> > > Rob
> > >
> > > ndrés Robinet | Lead Developer | BESTPLACE CORPORATION
> > > 5100 Bayview Drive 206, Royal Lauderdale Landings, Fort Lauderdale,
> >
> > FL
> >
> > > 33308
> > >
> > > | TEL 954-607-4207 | FAX 954-337-2695
> > >
> > > Email: [EMAIL PROTECTED]  | MSN Chat: [EMAIL PROTECTED]  |  SKYPE:
> > > bestplace |  Web: http://www.bestplace.biz | Web: http://www.seo-
> >
> > diy.com
> >
> >
> >
> > --
> > ---
> > Børge Holen
> > http://www.arivene.net



-- 
---
Børge Holen
http://www.arivene.net

--- End Message ---
--- Begin Message ---
Hello,

One of the values I'm passing in a URL string contains multiple spaces.

<a href="browse.php?DarScientificName=Argononemertes  australiensis">...</a>
(The multiple spaces are between Argononemertes and australiensis)

However when I retrieve the value using $_GET[DarScientificName]
there is only a single space between the two names which I understand is the 
intended behaviour?

Is there a way to preserve the multiple spaces?

Thanks
Craig.



Craig Churchill
Collection Systems Specialist
Museum Victoria
GPO Box 666
Melbourne VIC 3001
Australia
Telephone   +61 3 8341 7743
Email [EMAIL PROTECTED]
 

museumvictoria.com.au
This e-mail is solely for the named addressee and may be confidential.You 
should only read, disclose, transmit, copy, distribute, act in relianceon or 
commercialise the contents if you are authorised to do so. If you are not the 
intended recipient of this e-mail, please notify [EMAIL PROTECTED] by e-mail 
immediately, or notify the sender and then destroy any copy of this message. 
Views expressed in this e-mailare those of the individual sender, except where 
specifically stated to be those of an officer of Museum Victoria. Museum 
Victoria does not represent,warrant or guarantee that the integrity of this 
communication has been maintained nor that it is free from errors, virus or 
interference.

--- End Message ---
--- Begin Message ---
Try "%20" for each space. Better yet, use underscores "_"

Churchill, Craig wrote:
Hello,

One of the values I'm passing in a URL string contains multiple spaces.

<a href="browse.php?DarScientificName=Argononemertes  australiensis">...</a>
(The multiple spaces are between Argononemertes and australiensis)

However when I retrieve the value using $_GET[DarScientificName]
there is only a single space between the two names which I understand is the 
intended behaviour?

Is there a way to preserve the multiple spaces?

Thanks
Craig.



Craig Churchill
Collection Systems Specialist
Museum Victoria
GPO Box 666
Melbourne VIC 3001
Australia
Telephone   +61 3 8341 7743
Email [EMAIL PROTECTED]
museumvictoria.com.au
This e-mail is solely for the named addressee and may be confidential.You 
should only read, disclose, transmit, copy, distribute, act in relianceon or 
commercialise the contents if you are authorised to do so. If you are not the 
intended recipient of this e-mail, please notify [EMAIL PROTECTED] by e-mail 
immediately, or notify the sender and then destroy any copy of this message. 
Views expressed in this e-mailare those of the individual sender, except where 
specifically stated to be those of an officer of Museum Victoria. Museum 
Victoria does not represent,warrant or guarantee that the integrity of this 
communication has been maintained nor that it is free from errors, virus or 
interference.

--- End Message ---
--- Begin Message ---
Very nice link kingzones, I did not come across this one yet!

As I mentioned I was looking for some text books that I could keep on
hand... I can print some from the link you provided.  I was looking for a
bit more feed back :( maybe this is all I need :)  I do have the chm manual,
I use it a lot!

Thanks again!
Sean-Michael.

<[EMAIL PROTECTED]> wrote in message 
news:[EMAIL PROTECTED]
>I have learned PHP using PHP manual available at the www.php.net in chm
> format...
> You can also try.. my php free books collection here
> http://www.kingzones.org/bookszone/php.php
>
> But still I go with PHP manual...
>
>
> On Jan 11, 2008 11:42 PM, Sean-Michael <[EMAIL PROTECTED]> wrote:
>
>> I've been searching the web for all the tutorials I can on the subject of
>> php programming, I don't think there is a limit on what is really
>> available
>> to learn.
>>
>> What I want to ask is if anyone can recommend a good/best text book to
>> learn
>> from, I like to have a good book on hand!  I was going to purchase the 
>> Zen
>> Study Guide but after some research I cam to the conclusion that this is
>> not
>> a good book to buy, or perhaps it is a good companion to my online
>> studies?
>>
>> It's my understanding that this book would be best for me?
>>
>> PHP Objects, Patterns, and Practice, Second Edition
>>
>> http://www.amazon.com/PHP-Objects-Patterns-Practice-Second/dp/1590599098/ref=sr_1_2?ie=UTF8&s=books&qid=1200074884&sr=1-2
>>
>> Thanks in advance for advice with this!
>>
>> --
>> PHP General Mailing List (http://www.php.net/)
>> To unsubscribe, visit: http://www.php.net/unsub.php
>>
>>
>
>
> -- 
> Visit: http://www.kingzones.org/
> 

--- End Message ---
--- Begin Message ---
Sean-Michael wrote:
What I want to ask is if anyone can recommend a good/best text book to learn from, I like to have a good book on hand!

It's very difficult to recommend "the best" book to learn from (although I'm tempted to suggest my own). Different people learn in different ways. Also, people want to use PHP in different ways, not to mention the fact that you don't say what your current skill level is.

My advice would be to go to Amazon, and browse the books on PHP. Read the reviews. See which are the best sellers.

I have a lot of PHP books on my shelf. The two that are the most well-thumbed as "PHP Programming" by Rasmus Lerdorf and Kevin Tatroe, and "Upgrading to PHP 5" by Adam Trachtenberg.

The book by Matt Zandstra that you mention is very good, but it's very specialized. If you're already at an intermediate-advanced level, and want to learn about design patterns with PHP, it might be a good choice. If you're at a less advanced level, maybe not.

--
David Powers

--- End Message ---

Reply via email to