Re: [PHP] Upload not working...

2004-09-08 Thread Deependra b. Tandukar
Yes, this is what is missed: enctype="multipart/form-data"
Thanks !
DT
At 11:20 AM 9/8/2004 +0600, raditha dissanayake wrote:
Deependra b. Tandukar wrote:
I tried this form to upload a file.

...
This very code works in my home computer. I tried this with my local 
server at my office and my web server, both give the same message what is 
the wrong with it.

Suprised that it worked at all the  shouldbe : enctype="multipart/form-data"
DT

--
Raditha Dissanayake.

http://www.radinks.com/sftp/ | http://www.raditha.com/megaupload
Lean and mean Secure FTP applet with | Mega Upload - PHP file uploader
Graphical User Inteface. Just 128 KB | with progress bar.
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php
!DSPAM:413e93372028055245396!
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


Re: [PHP] Byte size of text?

2004-09-08 Thread Marek Kilimajer
John Smith wrote:
What's the most accurate way to get the byte count of
some text? Is strlen() accurate with Unicode, ASCII,
etc.?
John
strlen() is fine even for multibyte encodings, it does not know about 
encoding and returns the "raw" size. If you wanted the number of 
characters, you would need multibyte support.

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


Re: [PHP] Byte size of text?

2004-09-08 Thread Rasmus Lerdorf
On Wed, 8 Sep 2004, Marek Kilimajer wrote:
> John Smith wrote:
> > What's the most accurate way to get the byte count of
> > some text? Is strlen() accurate with Unicode, ASCII,
> > etc.?
> >
> > John
> >
>
> strlen() is fine even for multibyte encodings, it does not know about
> encoding and returns the "raw" size. If you wanted the number of
> characters, you would need multibyte support.

mbstring can overload strlen and give you the correct character count for
the various encodings.  See php.net/mbstring

-Rasmus

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



[PHP] PHP OOP Question

2004-09-08 Thread Paul Waring
> Is it bad practice for a class to have a variable and method of the same name?

Well, it's a matter of opinion what is and isn't bad practice, but
personally I would never give a variable and a function the same name
- if only to avoid confusion (PHP shouldn't mind if you do so though).

Paul

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



[PHP] Rsync + ssh

2004-09-08 Thread Syed Ghouse
Hi All
(B
(Bi m using rsync command to transfer files from server to server.
(B
(Bi use the below code
(B
(Brsync --password-file .passfile ssh [EMAIL PROTECTED]:/remote/dir /localdir/dir/
(B
(Bwhere .passfile has the password...
(B
(BBut eventhough i have passed the password file it asks for password...
(B
(BTell me how t use the rsync command with ssh and without prompting for password
(B
(BRegards
(B
(BSyed

Re: [PHP] Byte size of text?

2004-09-08 Thread Marek Kilimajer
Rasmus Lerdorf wrote:
On Wed, 8 Sep 2004, Marek Kilimajer wrote:
John Smith wrote:
What's the most accurate way to get the byte count of
some text? Is strlen() accurate with Unicode, ASCII,
etc.?
John
strlen() is fine even for multibyte encodings, it does not know about
encoding and returns the "raw" size. If you wanted the number of
characters, you would need multibyte support.

mbstring can overload strlen and give you the correct character count for
the various encodings.  See php.net/mbstring
John asked for byte count, not character count. So he cannot use 
mb_strlen().

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


Re: [PHP] Rsync + ssh

2004-09-08 Thread Jason Wong
On Wednesday 08 September 2004 17:10, Syed Ghouse wrote:
(B
(B> i m using rsync command to transfer files from server to server.
(B>
(B> i use the below code
(B>
(B> rsync --password-file .passfile ssh [EMAIL PROTECTED]:/remote/dir
(B> /localdir/dir/
(B>
(B> where .passfile has the password...
(B>
(B> But eventhough i have passed the password file it asks for password...
(B>
(B> Tell me how t use the rsync command with ssh and without prompting for
(B> password
(B
(BNB this whole question is OT, please find a more appropriate list.
(B
(BTo use ssh without passwords set up key files. Then use the following:
(B
(B rsync -av -e 'ssh -i /path/to/ssh/keyfile' /src /dest
(B
(B-- 
(BJason Wong -> Gremlins Associates -> www.gremlins.biz
(BOpen Source Software Systems Integrators
(B* Web Design & Hosting * Internet & Intranet Applications Development *
(B--
(BSearch the list archives before you post
(Bhttp://marc.theaimsgroup.com/?l=php-general
(B--
(B/*
(BThere *__is* intelligent life on Earth, but I leave for Texas on Monday.
(B*/
(B
(B-- 
(BPHP General Mailing List (http://www.php.net/)
(BTo unsubscribe, visit: http://www.php.net/unsub.php

[PHP] Re: referencing a class

2004-09-08 Thread Torsten Roehr
"Jed R. Brubaker" <[EMAIL PROTECTED]> wrote in message
news:[EMAIL PROTECTED]
> Quick question here. Has anyone run into trouble with a variable reference
> to a class object?
>
> Here is the code:
> $_SESSION['database'] = new Database;
> $this->db = &$_SESSION['database'];
>
> Everything goes screwy after a call like this.
>
> Thanks in advance!

What do you mean with "screwy"? Change $_SESSION['database'] after your
second line and print out $this->db to see if that was changed too.

Regards, Torsten Roehr

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



[PHP] Re: referencing a class

2004-09-08 Thread Torsten Roehr
"Jed R. Brubaker" <[EMAIL PROTECTED]> wrote in message
news:[EMAIL PROTECTED]
> Quick question here. Has anyone run into trouble with a variable reference
> to a class object?
>
> Here is the code:
> $_SESSION['database'] = new Database;
> $this->db = &$_SESSION['database'];
>
> Everything goes screwy after a call like this.
>
> Thanks in advance!

What do you mean with "screwy"? Change $_SESSION['database'] after your
second line and print out $this->db to see if that was changed too.

By the way, you mean "referencing an object" (not a class).

Regards, Torsten Roehr

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



Re: [PHP] Rsync + ssh

2004-09-08 Thread Paul Waring
> Tell me how t use the rsync command with ssh and without prompting for password

A little bit of politeness (including the word 'please') would go a long way...

Paul

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



Fw: [PHP] Rsync + ssh

2004-09-08 Thread Syed Ghouse

(BHi All
(B
(Bi m using rsync command to transfer files from server to server.
(B
(Bi use the below code
(B
(Brsync --password-file .passfile ssh [EMAIL PROTECTED]:/remote/dir
(B/localdir/dir/
(B
(Bwhere .passfile has the password...
(B
(BBut eventhough i have passed the password file it asks for password...
(B
(BPlease anybody tell me how t use the rsync command with ssh and without
(Bprompting for password
(B
(BRegards
(B
(BSyed
(B
(B-- 
(BPHP General Mailing List (http://www.php.net/)
(BTo unsubscribe, visit: http://www.php.net/unsub.php

RE: [PHP] array

2004-09-08 Thread Jay Blanchard
[snip]
I'm reading data. Can I open a connection within a connection and write
data to another $db.$table or do I have to write my data to an array. In
an array, how do I do this?

I've looked at array_push, but don't think this is what I want?
$authors = array();
  array_push($singleauthor,$mydata->id);
I've been reading http://ca3.php.net/manual/en/function.array-push.php
[/snip]

Here is some pseudo-code that may help...

$sqlSelect = "SELECT `foo` FROM `table1` WHERE condition ";
$sqlQuery = mysql_query($sqlSelect, $myConnection);

while($row = mysql_fetch_array($sqlQuery)){
echo $row['foo'] . "\n"; // so we can see `foo`
$sqlInsert = "INSERT INTO `table2`(`newFoo`) ";
$sqlInsert .= "VALUES('" . $row['foo'] . "') ";
$sqlInQuery = mysql_query($sqlInsert, $myConnection);
}

What is bad here is that an INSERT is called each time through the loop
for `foo`, which may be inefficient. As with anything PHP there is more
than one way to skin a cat though.

$arrayIndex = 0;
while($row = mysql_fetch_array($sqlQuery)){
$newFooArray[$arrayIndex] = $row['foo'];
$arrayIndex++;
}

for($i = 0; $i < count($newFooArray); $i++){
echo $newFooArray[$i] . "\n";
$sqlInsert = "INSERT INTO `table2`(`newFoo`) ";
$sqlInsert .= "VALUES('" . $newFooArray[$i] . "') ";
$sqlInQuery = mysql_query($sqlInsert, $myConnection);
}

Again, the INSERT is called each time.

There is one more way to do this, and it would all be in one query. This
the most efficient, especially if you do not have to manipulate the data
before placing it in the second table.

$sqlSelectAndInsert = "INSERT INTO `table2` (`newFoo`) ";
$sqlSelectAndInsert .= "SELECT `foo` FROM `table1` ";
$sqlSelectAndInsert .= "WHERE conditions ";
$sqlSIQuery = mysql_query($sqlSelectAndInsert, $myConnection);

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



Re: Fw: [PHP] Rsync + ssh

2004-09-08 Thread John Nichel
Syed Ghouse wrote:
Please anybody tell me how t use the rsync command with ssh and without
prompting for password
I must have missed the php part of this question.
Here, this is how to use rsync...
Ask on the proper list!
--
John C. Nichel
ÜberGeek
KegWorks.com
716.856.9675
[EMAIL PROTECTED]
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


[PHP] Re: referencing a class

2004-09-08 Thread Matthew Weier O'Phinney
* Jed R. Brubaker <[EMAIL PROTECTED]>:
> Quick question here. Has anyone run into trouble with a variable reference 
> to a class object?
>
> Here is the code:
> $_SESSION['database'] = new Database;
> $this->db = &$_SESSION['database'];
>
> Everything goes screwy after a call like this.

You don't say what version of PHP you're using, but I'm guessing 4 (as
PHP5 passes all objects by reference).

They way I've handled the above is as follows:

$_SESSION['database'] =& new Database;
$this->db =& $_SESSION['database'];

You need to get a reference to the object from the very beginning; I've
tried a variety of ways, and this is the only one that works
consistently.

-- 
Matthew Weier O'Phinney   | mailto:[EMAIL PROTECTED]
Webmaster and IT Specialist   | http://www.garden.org
National Gardening Association| http://www.kidsgardening.com
802-863-5251 x156 | http://nationalgardenmonth.org

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



Re: [PHP] Re: Problem compiling PHP5 [solved]

2004-09-08 Thread Jim Grill
> WHOHOO!
>
> up2date -i XFree86-devel
>
> ./configure --with-mysql=/usr/local/mysql
> --with-apxs=/etc/httpd/bin/apxs --with-gd --with-png
> --with-zlib-dir=/root/zlib-1.2.1 --enable-gd-native-ttf --with-ttf
> --with-jpeg-dir=/usr/local/lib/jpeg-6b/
> --with-freetype-dir=/usr/local/lib/freetype-2.1.9/ --with-freetype-dir
> --with-xpm-dir=/usr/X11R6/
>
> works wonders.
>
> Thanks all!
>
> paul
>

Congrats!

There's nothing quite like the feeling of victory! :-) I thought it might
have something to do with the xpm library not being installed correctly or
not being built properly for your system.

Have fun,

Jim Grill

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



[PHP] imap_open() on windows extremely slow?

2004-09-08 Thread Michael Wallner
Hi,

I wonder if anyone experienced the same as I did the last few
days.  If I call imap_open() on linux it takes less than 0.2s
to return, but if I try that on windows it needs about 5s! to
successfully connect to the imap server.

Is this behaviour naturally?
My connection string looks like the following:
{ip.ip.ip.ip:143/imap/notls}INBOX

Some technical details:
Windows 2000SP4
PHP 4.3.8
Courier IMAP 0.45.6.20040712 on Debian
no matter if CLI or Apache2 SAPI

I'd really appreciate any comments, despite "use $unixoidOS" :)

Thanks,
-- 
Michael - < mike(@)php.net >



signature.asc
Description: OpenPGP digital signature


Re: [PHP] imap_open() on windows extremely slow?

2004-09-08 Thread raditha dissanayake
Michael Wallner wrote:
Hi,
I wonder if anyone experienced the same as I did the last few
days.  If I call imap_open() on linux it takes less than 0.2s
to return, but if I try that on windows it needs about 5s! to
successfully connect to the imap server.
Is this behaviour naturally?
My connection string looks like the following:
{ip.ip.ip.ip:143/imap/notls}INBOX
 

let me guess ip.ip.ip.ip=127.0.0.1 ? (when in linux)
if yes this behaviour isn't really worth worrying about.
--
Raditha Dissanayake.

http://www.radinks.com/sftp/ | http://www.raditha.com/megaupload
Lean and mean Secure FTP applet with | Mega Upload - PHP file uploader
Graphical User Inteface. Just 128 KB | with progress bar.
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


[PHP] foreach()

2004-09-08 Thread Anthony Ritter
Greetings,
The following code is from "Learning PHP5 [O'Reilly] on page 90.  Example -
6.5:

I get a:

Warning: Invalid argument supplied for foreach() in
c:\apache\htdocs\or_6.4.php on line 15

after submitting the form.

I'm not sure why since the example uses the call to foreach() in which the
array $lunch is passes through the call to retireve the values of the array

Thank you for your help.
TR




BBQ Pork Bun
Chicken Bun
Lotus Seed Bun
Bean Paste Bun
Bird-Nest Bun




Selected buns:

";
 }
?>

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



Re: [PHP] foreach()

2004-09-08 Thread Matt M.
> Warning: Invalid argument supplied for foreach() in
> c:\apache\htdocs\or_6.4.php on line 15

do a print_r on $_POST to see what is in the array.

> 
> 
> BBQ Pork Bun
> Chicken Bun
> Lotus Seed Bun
> Bean Paste Bun
> Bird-Nest Bun
> 
> 
> 
> 
> Selected buns:
> 
>  foreach ($_POST['lunch'] as $choice)
>  {
>   print "You want a $choice bun.";
>  }
> ?>

looks like you are posting to another page, eat.php

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



[PHP] Re: Cardservice lphp won't create array

2004-09-08 Thread Brian Dunning
But I get:
   Warning: Variable passed to each() is not an array or object
I assume you have instantiated the $mylphp object with "new"?
Yes, in fact I'm using their demo files just to eliminate all the 
possible variables. It seems to only be a problem on my development 
server. Works fine in production. It sounds like it should be 
correctible by editing something in php.ini but nothing jumps out at 
me...

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


[PHP] Re: foreach()

2004-09-08 Thread Daniel Kullik
Anthony Ritter wrote:
I get a:
Warning: Invalid argument supplied for foreach() in
c:\apache\htdocs\or_6.4.php on line 15
after submitting the form.
Hello Anthony!
As long as you don't submit the form with a single option selected there 
will be no $_POST['lunch'], therefore foreach() won't be able to loop 
through it.

Add the line print_r($_POST) to your code in order to see what actually 
happens if you hit the submit-button of your form.

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


[PHP] class packages

2004-09-08 Thread Jed R. Brubaker
As far as I can tell there is not an easy way yet to create packages in 
PHP5.

It seems the following is the best option:
include('classes/help/Search.inc');

// Inside Search.inc and in the same "package"
include('OtherClass.inc');
include('AnotherClass.inc');

Is there a better way?

Thanks! 

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



Re: [PHP] class packages

2004-09-08 Thread Jason Davidson
Out of curiosity, how would you prefer it?

the way you mentioend is basically how i do though.

Jason

"Jed R. Brubaker" <[EMAIL PROTECTED]> wrote: 
> 
> As far as I can tell there is not an easy way yet to create packages in 
> PHP5.
> 
> It seems the following is the best option:
> include('classes/help/Search.inc');
> 
> // Inside Search.inc and in the same "package"
> include('OtherClass.inc');
> include('AnotherClass.inc');
> 
> Is there a better way?
> 
> Thanks! 
> 
> -- 
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
> 
> 

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



[PHP] Re: class packages

2004-09-08 Thread Jed R. Brubaker
Oh - and naming conventions.
Do you define the class?:

class help.Search {
}


"Jed R. Brubaker" <[EMAIL PROTECTED]> wrote in message 
news:[EMAIL PROTECTED]
> As far as I can tell there is not an easy way yet to create packages in 
> PHP5.
>
> It seems the following is the best option:
> include('classes/help/Search.inc');
>
> // Inside Search.inc and in the same "package"
> include('OtherClass.inc');
> include('AnotherClass.inc');
>
> Is there a better way?
>
> Thanks! 

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



Re: [PHP] class packages

2004-09-08 Thread Alex Hogan
> > It seems the following is the best option:
> > include('classes/help/Search.inc');
> >
> > // Inside Search.inc and in the same "package"
> > include('OtherClass.inc');
> > include('AnotherClass.inc');
> >
> > Is there a better way?

I do pretty much the same thing but with a config.php file.

I have in my directory structure a configuration file that will
override the current config file settings when the contents changes
depending on the requirements of the directory.  So in my directory
that processes email I have a config.php file that will include the
class files necessary for the email functionality.  In the admin
section I have a config.php file that includes the admin
authorization, editing and insertion, and modification class files.

I don't know if it's a right way or wrong way.., it just seemed to
make sense to do it like that.


alex hogan

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



Re: [PHP] class packages

2004-09-08 Thread Jed R. Brubaker
Well, my OO experience comes from Java and ActionScript2.0, so there is 
compilation going on and classes get refered to as named that assume files 
(as you probably know).

As I just added to my original post, I am also wondering about naming 
conventions:

Quote:
--
Do you define the class?:

class help.Search {
}
--




"Jason Davidson" <[EMAIL PROTECTED]> wrote in message 
news:[EMAIL PROTECTED]
> Out of curiosity, how would you prefer it?
>
> the way you mentioend is basically how i do though.
>
> Jason
>
> "Jed R. Brubaker" <[EMAIL PROTECTED]> wrote:
>>
>> As far as I can tell there is not an easy way yet to create packages in
>> PHP5.
>>
>> It seems the following is the best option:
>> include('classes/help/Search.inc');
>>
>> // Inside Search.inc and in the same "package"
>> include('OtherClass.inc');
>> include('AnotherClass.inc');
>>
>> Is there a better way?
>>
>> Thanks!
>>
>> -- 
>> PHP General Mailing List (http://www.php.net/)
>> To unsubscribe, visit: http://www.php.net/unsub.php
>>
>> 

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



Re: [PHP] class packages

2004-09-08 Thread Jim Grill
> As far as I can tell there is not an easy way yet to create packages in
> PHP5.
>
> It seems the following is the best option:
> include('classes/help/Search.inc');
>
> // Inside Search.inc and in the same "package"
> include('OtherClass.inc');
> include('AnotherClass.inc');
>
> Is there a better way?
>
> Thanks!
>

Not really... That is about it.

PHP does not offer a way to group classes, scripts, and functions into
logical "packages" or "applications" like some other languages do (asp comes
to mind (and no, I'm not an asp advocate)). However, while it's common to
save each class in its own file, it isn't at all uncommon to have multiple
classes in a single file - especially if they are typically used together
like parent and extended classes or interfaces and implementations. This
method will also save disk io by only having to include one file.

Jim Grill

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



[PHP] Re: imap_open() on windows extremely slow?

2004-09-08 Thread Michael Wallner
Hi Raditha Dissanayake, you wrote:

> let me guess ip.ip.ip.ip=127.0.0.1 ? (when in linux)

Yes, that's true.

> if yes this behaviour isn't really worth worrying about.

So you say it'd take equally long to call imap_open() from
a remote linux machine?  5 seconds seem far too long for
me, though...

Regards,
-- 
Michael - < mike(@)php.net >


signature.asc
Description: OpenPGP digital signature


Re: [PHP] Re: imap_open() on windows extremely slow?

2004-09-08 Thread raditha dissanayake
Michael Wallner wrote:
Hi Raditha Dissanayake, you wrote:
 

let me guess ip.ip.ip.ip=127.0.0.1 ? (when in linux)
   

Yes, that's true.
 

if yes this behaviour isn't really worth worrying about.
   

So you say it'd take equally long to call imap_open() from
a remote linux machine?  5 seconds seem far too long for
me, though...
 

What I am saying is that opening a socket connection has plenty of over 
heads whether it's imap or not. It's for this reason that most clients 
(mail or otherwise) keep the connection open for short durations even if 
no data is exchanged. Don't lose hair over these five seconds even 
though it appears to be a bit too long.


Regards,
 


--
Raditha Dissanayake.

http://www.radinks.com/sftp/ | http://www.raditha.com/megaupload
Lean and mean Secure FTP applet with | Mega Upload - PHP file uploader
Graphical User Inteface. Just 128 KB | with progress bar.
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


Re: [PHP] class packages

2004-09-08 Thread Alex Hogan
> Do you define the class?:
> 
> class help.Search {
> }

No..,

In your example you are defining the search class in the Help
namespace, just like you would in ActionScript.

I don't think you can do that in php.  
You would just use;
class Search{
  // do stuff here
}

You can extend the class using;

class subSearch extends Search{
  // do stuff here
}



alex hogan

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



Re: [PHP] Intermittent Seg Fault with PHP4.3.8 + FTP

2004-09-08 Thread Steve Brown
> OK. Sounds like a genuine segfault to me. The CLI version will simply print
> "Segmentation fault" to the screen or "Segmentation fault (core dumped)"
> when configured with debugging enabled.

Thanks for the help Jim.  I had to install gdb and recompile php, but
I was able to get consistant backtraces from both systems.  When the
fault occured, the backtrace was identical every time.  It appears to
be an issue with memchr() in ftp_get():

=
Program received signal SIGSEGV, Segmentation fault.
0x4207bae0 in memchr () from /lib/tls/libc.so.6
(gdb) bt
#0  0x4207bae0 in memchr () from /lib/tls/libc.so.6
#1  0x0807ebb0 in ftp_get (ftp=0x8366c4c, outstream=0x83a2204,
path=0x839868c "/x-stuff/mir_libraries/lib-nusoap-066.php",
type=FTPTYPE_ASCII, resumepos=0)
   at /usr/local/src/php-4.3.8/ext/ftp/ftp.c:730
#2  0x0807bf69 in zif_ftp_get (ht=4, return_value=0x83a0f9c,
this_ptr=0x0, return_value_used=1) at
/usr/local/src/php-4.3.8/ext/ftp/php_ftp.c:637
#3  0x081ecfb0 in execute (op_array=0x836c920) at
/usr/local/src/php-4.3.8/Zend/zend_execute.c:1635
#4  0x081ed22b in execute (op_array=0x836d648) at
/usr/local/src/php-4.3.8/Zend/zend_execute.c:1679
#5  0x081ed22b in execute (op_array=0x8366b74) at
/usr/local/src/php-4.3.8/Zend/zend_execute.c:1679
#6  0x081d9783 in zend_execute_scripts (type=8, retval=0x0,
file_count=3) at /usr/local/src/php-4.3.8/Zend/zend.c:891
#7  0x0819e9b7 in php_execute_script (primary_file=0xbad0) at
/usr/local/src/php-4.3.8/main/main.c:1734
#8  0x081f3e3d in main (argc=2, argv=0xbb64) at
/usr/local/src/php-4.3.8/sapi/cli/php_cli.c:822
===

I did some searching through the bug list and didn't find anything
that appeared to be related to this issue.  I've created bug #30027,
so hopefully this will be addressed soon.  Thanks for your help!

Steve

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



[PHP] What's faster? MySQL Queries or PHP Loops?

2004-09-08 Thread Robb Kerr
Here's the scenario...

First, my HTTP Server (Apache), PHP Server and MySQL Server are on the same 
machine - an Apple Xserve.

Second, I've got a page with a long repeat region reflecting a recordset 
queried out of a MySQL table. The region also displays information obtained 
from fields in a related table.

Third, I use Dreamweaver to generate my MySQL recordsets and repeat 
regions.

Here's the question...

I can either A) in the header or my page, generate a recordset of all of 
the records in the related table and then loop through the recordset 
creating an array of the fields I need and then later pull from it in the 
repeat region... or B) take the six lines of code Dreamweaver generates to 
create a recordset and move them into the repeat region itself. In other 
words, I can create a recordset of all of the records in the related table, 
loop through it generating a PHP array and pull from this array later OR I 
can query the database every time through the loop while creating the 
repeat region.

Since I haven't freed the table until the bottom of the page and because my 
MySQL Sever and PHP Server reside on the same machine, will I really notice 
a measurable difference in speed? If my MySQL Server were a different 
machine, I'm sure that there would be a noticable difference because all of 
the queries would be across a network (possibly the internet) and traffic 
would become a factor.

Just wondering what other people have noticed.
-- 
Robb Kerr
Digital IGUANA
Helping Digital Artists Achieve their Dreams

http://www.digitaliguana.com
http://www.cancerreallysucks.org

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



Re: [PHP] class packages

2004-09-08 Thread Jed R. Brubaker
Alex,

You suggestion about the config file is interesting, but while I go and 
re-read your post, I am wondering how you would avoid class name conflicts.

Point and case, the only reason I am going after packages is because I have 
a search class that is used for something else, and I want to not have to 
name my other class "SearchHelp".

I am going to run into conflicts if I include two class definitions for 
search, am I not?

Thanks again for all of the insight!


"Alex Hogan" <[EMAIL PROTECTED]> wrote in message 
news:[EMAIL PROTECTED]
>> Do you define the class?:
>>
>> class help.Search {
>> }
>
> No..,
>
> In your example you are defining the search class in the Help
> namespace, just like you would in ActionScript.
>
> I don't think you can do that in php.
> You would just use;
> class Search{
>  // do stuff here
> }
>
> You can extend the class using;
>
> class subSearch extends Search{
>  // do stuff here
> }
>
>
>
> alex hogan 

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



Re: [PHP] Intermittent Seg Fault with PHP4.3.8 + FTP

2004-09-08 Thread Jim Grill
> Thanks for the help Jim.  I had to install gdb and recompile php, but
> I was able to get consistant backtraces from both systems.  When the
> fault occured, the backtrace was identical every time.  It appears to
> be an issue with memchr() in ftp_get():
>
> =
> Program received signal SIGSEGV, Segmentation fault.
> 0x4207bae0 in memchr () from /lib/tls/libc.so.6
> (gdb) bt
> #0  0x4207bae0 in memchr () from /lib/tls/libc.so.6
> #1  0x0807ebb0 in ftp_get (ftp=0x8366c4c, outstream=0x83a2204,
> path=0x839868c "/x-stuff/mir_libraries/lib-nusoap-066.php",
> type=FTPTYPE_ASCII, resumepos=0)
>at /usr/local/src/php-4.3.8/ext/ftp/ftp.c:730
> #2  0x0807bf69 in zif_ftp_get (ht=4, return_value=0x83a0f9c,
> this_ptr=0x0, return_value_used=1) at
> /usr/local/src/php-4.3.8/ext/ftp/php_ftp.c:637
> #3  0x081ecfb0 in execute (op_array=0x836c920) at
> /usr/local/src/php-4.3.8/Zend/zend_execute.c:1635
> #4  0x081ed22b in execute (op_array=0x836d648) at
> /usr/local/src/php-4.3.8/Zend/zend_execute.c:1679
> #5  0x081ed22b in execute (op_array=0x8366b74) at
> /usr/local/src/php-4.3.8/Zend/zend_execute.c:1679
> #6  0x081d9783 in zend_execute_scripts (type=8, retval=0x0,
> file_count=3) at /usr/local/src/php-4.3.8/Zend/zend.c:891
> #7  0x0819e9b7 in php_execute_script (primary_file=0xbad0) at
> /usr/local/src/php-4.3.8/main/main.c:1734
> #8  0x081f3e3d in main (argc=2, argv=0xbb64) at
> /usr/local/src/php-4.3.8/sapi/cli/php_cli.c:822
> ===
>
> I did some searching through the bug list and didn't find anything
> that appeared to be related to this issue.  I've created bug #30027,
> so hopefully this will be addressed soon.  Thanks for your help!
>
> Steve
>

Looks good. ...uh.. I mean bad... uh, you know what I mean :-)

Good job.

...and just for clarification... after re-reading my response to you it came
to my attention that one might assume I'm somehow involved with PHP
development.

I said:

"It will be much appreciated if you follow the above steps and include
sample code and gdb information when submitting a bug. Leave it to the real
pros to read the backtrace output!"

What I meant was that it would be appreciated by the good folks who work on
php bugs -- they are the pros. I'm nobody - just a php lover on the cutting
edge of the latest cvs snap, so chasing bugs has become somewhat of an
interest/hobby for me. :-) (Sadly, I have yet to find a real live unreported
bug myself)

Best of luck to you,

Jim Grill

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



Re: [PHP] Intermittent Seg Fault with PHP4.3.8 + FTP

2004-09-08 Thread Steve Brown
> ...and just for clarification... after re-reading my response to you it came
> to my attention that one might assume I'm somehow involved with PHP
> development.

You mean you won't be the person fixing this bug??  Man, I'm screwed
now!  j/k ;-)

No worries!

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



Re: [PHP] What's faster? MySQL Queries or PHP Loops?

2004-09-08 Thread Jim Grill
> Here's the question...
>
> I can either A) in the header or my page, generate a recordset of all of
> the records in the related table and then loop through the recordset
> creating an array of the fields I need and then later pull from it in the
> repeat region... or B) take the six lines of code Dreamweaver generates to
> create a recordset and move them into the repeat region itself. In other
> words, I can create a recordset of all of the records in the related
table,
> loop through it generating a PHP array and pull from this array later OR I
> can query the database every time through the loop while creating the
> repeat region.
>
> Robb Kerr
> Digital IGUANA
> Helping Digital Artists Achieve their Dreams
> 
> http://www.digitaliguana.com
> http://www.cancerreallysucks.org
>
Robb,

How about choice "C"? :-)

Query once if you can. Running multiple queries in a loop is always going to
be slower. Now, I'm not totally sure I understand the problem. It sounds
like you have one table to query and then you query a second table??? If
that's true then what about a join to get everything you need from both
tables at once? The idea here is that you get one result from MySQL and then
loop through your result and display your content.

Hope I'm not too far off.

Jim Grill



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



RE: [PHP] What's faster? MySQL Queries or PHP Loops?

2004-09-08 Thread Dan Joseph
> I can either A) in the header or my page, generate a recordset of all of
> the records in the related table and then loop through the recordset
> creating an array of the fields I need and then later pull from it in the
> repeat region... or B) take the six lines of code Dreamweaver generates to
> create a recordset and move them into the repeat region itself. In other
> words, I can create a recordset of all of the records in the related
> table,
> loop through it generating a PHP array and pull from this array later OR I
> can query the database every time through the loop while creating the
> repeat region.
> 
> Since I haven't freed the table until the bottom of the page and because
> my
> MySQL Sever and PHP Server reside on the same machine, will I really
> notice
> a measurable difference in speed? If my MySQL Server were a different
> machine, I'm sure that there would be a noticable difference because all
> of
> the queries would be across a network (possibly the internet) and traffic
> would become a factor.

Accessing an array is always faster than looping thru query results
from an SQL database.

Question though...  Your page runs, grabs the data for the array,
builds the page, then is done.  At that point, your array is gone, and the
next page load would loop thru the database and create the array again.
This is doing double work.  Is this how you're running?  Just a page?  Just
want to clarify.  If that's the case, don't worry about the array, just hit
the SQL server each time.

-Dan Joseph

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



Re: [PHP] Re: imap_open() on windows extremely slow?

2004-09-08 Thread Michael Wallner
Hi Raditha Dissanayake, you wrote:

> What I am saying is that opening a socket connection has plenty of
> over heads whether it's imap or not. It's for this reason that most
> clients (mail or otherwise) keep the connection open for short
> durations even if no data is exchanged. Don't lose hair over these
> five seconds even though it appears to be a bit too long.

bit too long !== far too long ;)

Well, so here comes /the oddity/

connecting from debian to windows/exchange ~0.5 seconds
connecting from debian to debian/courier ~0.2 (assumed to be somewhere at 0.x seconds)
connecting from windows to debian/courier ~5 seconds
connecting from windows to windows/exchange ~0.5 seconds

Half a second is what I'd expect and is acceptable, but
5 seconds seems to be more serious than an oddity...

Somewhat confused,
-- 
Michael - < mike(@)php.net >


signature.asc
Description: OpenPGP digital signature


Re: [PHP] What's faster? MySQL Queries or PHP Loops?

2004-09-08 Thread Chris Shiflett
--- Robb Kerr <[EMAIL PROTECTED]> wrote:
> Here's the question...
> 
> I can either A) in the header or my page, generate a recordset
> of all of the records in the related table and then loop through
> the recordset creating an array of the fields I need and then
> later pull from it in the repeat region... or B) take the six
> lines of code Dreamweaver generates to create a recordset and
> move them into the repeat region itself.

I don't completely understand your terminology, but it's always faster to
get all of your data with a single query rather than a query per loop. Of
course, the difference is that it also requires more memory. In general,
if you have the memory, use it. It will always be faster.

Hope that helps.

Chris

=
Chris Shiflett - http://shiflett.org/

PHP Security - O'Reilly
 Coming Fall 2004
HTTP Developer's Handbook - Sams
 http://httphandbook.org/
PHP Community Site
 http://phpcommunity.org/

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



Re: [PHP] class packages

2004-09-08 Thread Alex Hogan
> You suggestion about the config file is interesting, but while I go and
> re-read your post, I am wondering how you would avoid class name conflicts.

I try to avoid using the same name for different classes.

> Point and case, the only reason I am going after packages is because I have
> a search class that is used for something else, and I want to not have to
> name my other class "SearchHelp".

Are there extensive differences between the two classes?

Could you extend the search class and get the same results?

You could name the two classes the same and call them using the same
name but call two differnent files.  I've never done that but I don't
see why it wouldn't work.

> I am going to run into conflicts if I include two class definitions for
> search, am I not?

Yep. If you call them both at the same time.



alex hogan

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



Re: [PHP] Re: Cardservice lphp won't create array

2004-09-08 Thread Brian Dunning
It seems the problem is that port 1129 is blocked somewhere, which lphp 
needs to communicate with Cardservice. Sorry for the noise, hope this 
is helpful to someone else.  :)

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


Re: [PHP] What's faster? MySQL Queries or PHP Loops?

2004-09-08 Thread Galen
Almost all the time (unless the data being worked with is extremely, 
extremely large) PHP is much faster at manipulating data than MySQL. So 
if you already have the record set pulled out of MySQL, you probably 
want to go with PHP to manipulate it. Especially for repeating like 
this, there is zero reason to be querying MySQL excessively. Even if 
you have a huge chunk of data, I'd pull a big chunk of the records at a 
time and only query MySQL every 200 KB or something.

You still may want to check the performance (never a bad idea to find 
those slow parts of your code), so use a simple function like this to 
benchmark:


$time_start = microtime_float();
// Sleep for a while
usleep(100);
$time_end = microtime_float();
$time = $time_end - $time_start;
 echo "Did nothing in $time seconds\n";
?>
(from http://php.net/microtime )
-Galen
On Sep 8, 2004, at 8:22 AM, Robb Kerr wrote:
Here's the scenario...
First, my HTTP Server (Apache), PHP Server and MySQL Server are on the 
same
machine - an Apple Xserve.

Second, I've got a page with a long repeat region reflecting a 
recordset
queried out of a MySQL table. The region also displays information 
obtained
from fields in a related table.

Third, I use Dreamweaver to generate my MySQL recordsets and repeat
regions.
Here's the question...
I can either A) in the header or my page, generate a recordset of all 
of
the records in the related table and then loop through the recordset
creating an array of the fields I need and then later pull from it in 
the
repeat region... or B) take the six lines of code Dreamweaver 
generates to
create a recordset and move them into the repeat region itself. In 
other
words, I can create a recordset of all of the records in the related 
table,
loop through it generating a PHP array and pull from this array later 
OR I
can query the database every time through the loop while creating the
repeat region.

Since I haven't freed the table until the bottom of the page and 
because my
MySQL Sever and PHP Server reside on the same machine, will I really 
notice
a measurable difference in speed? If my MySQL Server were a different
machine, I'm sure that there would be a noticable difference because 
all of
the queries would be across a network (possibly the internet) and 
traffic
would become a factor.

Just wondering what other people have noticed.
--
Robb Kerr
Digital IGUANA
Helping Digital Artists Achieve their Dreams

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

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


Re: [PHP] remote script execution

2004-09-08 Thread Sean Smith
I had SSH setup to require passwords when logging in, so that is why I 
was having trouble trying to figure out how to get it to work. I now 
have the two servers in question setup to auto login based on their 
keys. I have successfully run the remote script from the CLI on server 
1. Now I just need to get it integrated into my GUI. A huge thanks to 
Warren and the others that have replied to my post. This is why I have 
become an adimant supporter of Linux, Apache, Mysql, PHP (LAMP), and 
Open Source Technology in general. The community that is in place for 
support and new ideas is awesome. I just hope that I can become such a 
help in the future. Thanks again.

Sean
Vail, Warren wrote:
Ignoring PHP for a moment; to execute a string of commands on a remote
machine using ssh you would execute the following;
Prompt>ssh -l user "ps -ef|grep edit;cd /usr/local/bin;ls -la"
Which would result in showing any edit processes, followed by a listing of
the contents of the /usr/local/bin directory.
Notice that I did not include a password (this is not needed if the two
servers have already exchanged security keys), and as near as I know, cannot
be supplied unless you are there to type it in on a tty type device, so be
sure to get the keys setup properly.  You will also need the client program
"ssh" installed on the originating machine, and the daemon "sshd" installed
on the remote machine, but then you probably knew that ;-)
In PHP simply;
$cmd = "ssh -l user \"ps -ef|grep edit;cd /usr/local/bin;ls -la";
$rtn = exec($cmd, $responselines);
http://us4.php.net/manual/en/function.exec.php
$responselines is now an array containing lines of output from the commands.
Hope this helps,
Warren Vail
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


[PHP] data grids...

2004-09-08 Thread blackwater dev
Does anyone have a nice clean way to provide data grids with php short
of simply creating a bunch of input boxes or using flash?

Thanks!

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



Re: [PHP] What's faster? MySQL Queries or PHP Loops?

2004-09-08 Thread Robb Kerr
On Wed, 8 Sep 2004 10:30:59 -0500, Jim Grill wrote:

>> Here's the question...
>>
>> I can either A) in the header or my page, generate a recordset of all of
>> the records in the related table and then loop through the recordset
>> creating an array of the fields I need and then later pull from it in the
>> repeat region... or B) take the six lines of code Dreamweaver generates to
>> create a recordset and move them into the repeat region itself. In other
>> words, I can create a recordset of all of the records in the related
> table,
>> loop through it generating a PHP array and pull from this array later OR I
>> can query the database every time through the loop while creating the
>> repeat region.
>>
>> Robb Kerr
>> Digital IGUANA
>> Helping Digital Artists Achieve their Dreams
>> 
>> http://www.digitaliguana.com
>> http://www.cancerreallysucks.org
>>
> Robb,
> 
> How about choice "C"? :-)
> 
> Query once if you can. Running multiple queries in a loop is always going to
> be slower. Now, I'm not totally sure I understand the problem. It sounds
> like you have one table to query and then you query a second table??? If
> that's true then what about a join to get everything you need from both
> tables at once? The idea here is that you get one result from MySQL and then
> loop through your result and display your content.
> 
> Hope I'm not too far off.
> 
> Jim Grill

That brings up another question which I know actually belongs over on the
MySQL board, but since the question arose here I thought I'd post here. I
understood that MyISAM tables could not be relational. Do you mean that I
can create JOINs between MyISAM tables? Maybe I need to do some more
research into table types?
-- 
Robb Kerr
Digital IGUANA
Helping Digital Artists Achieve their Dreams

http://www.digitaliguana.com
http://www.cancerreallysucks.org

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



RE: [PHP] What's faster? MySQL Queries or PHP Loops?

2004-09-08 Thread Jay Blanchard
[snip]
I don't completely understand your terminology, but it's always faster
to get all of your data with a single query rather than a query per
loop. Of course, the difference is that it also requires more memory. In
general,
if you have the memory, use it. It will always be faster.
[/snip] 

+1

However, there is a point of diminishing returns that we haven't spoken
of. Dependent upon hardware and overhead, the size of the data to be
manipulated (say 10k records vs. 100k records, in numbers or record
size) will play an important part in speed. Always most efficient is the
query once model. Don't forget that inserts and updates always take
longer (especially with indexed columns). For mid-sized (and I know that
for each of us that is defined differently) databases it's a real
balancing act.

One thing that needs to be pointed out here is that you can use PHP and
MySQL to the fullest by planning data manipulation with PHP more
efficiently. It takes more work up front to figure out all of the
details but consider the following examples

-
$bar = 12;
$sql = "SELECT `foo` FROM `table1` WHERE conditions ";
$result = mysql_query($sql, $connection);
while($row = mysql_fetch_array($result)){
$insert = "INSERT INTO `table2` (`newFoo`) VALUES ('" . ($bar +
$row['foo']) . "') ";
$insertResult = mysql_query($insert, $connection);
}
-

or you could do this 

-
$bar = 12;
$sqlSelectCalculateAndInsert = "INSERT INTO `table2` (`newFoo`) ";
$sqlSelectCalculateAndInsert .= "SELECT (`foo` + " . $bar . ") FROM
`table` WHERE conditions ";
$result = mysql_query($sqlSelectCalculateAndInsert, $connection);
-

HTH

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



Re: [PHP] data grids...

2004-09-08 Thread John Holmes
From: "blackwater dev" <[EMAIL PROTECTED]>
Does anyone have a nice clean way to provide data grids with php short
of simply creating a bunch of input boxes or using flash?
You mean using HTML/DHTML/CSS, etc. instead of PHP. PHP just creates the 
code to send to the browser.

To answer your question, though, if you're stuck with HTML, then the "bunch 
of textboxes" is your only option. Flash is probably your best bet if you 
want a true grid or maybe some ActiveX/Java plug in?

---John Holmes... 

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


[PHP] Users of RDBMS

2004-09-08 Thread Pahlevanzadeh Mohsen
Dears,
I need to create user for MySQL.
Please guide me..

=
-DIGITAL  SIGNATURE---
///Mohsen Pahlevanzadeh
 Network administrator  & programmer 
  My home phone is: +98213810146  
My email address is  
  m_pahlevanzadeh at yahoo dot com   
My website is: http://webnegar.net




__
Do you Yahoo!?
New and Improved Yahoo! Mail - Send 10MB messages!
http://promotions.yahoo.com/new_mail 

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



Re: [PHP] data grids...

2004-09-08 Thread Greg Donald
On Wed, 2004-09-08 at 13:15, blackwater dev wrote:
> Does anyone have a nice clean way to provide data grids with php short
> of simply creating a bunch of input boxes or using flash?

What is a 'data grid' ?


-- 
Greg Donald

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



RE: [PHP] data grids...

2004-09-08 Thread Jay Blanchard
[snip]
Does anyone have a nice clean way to provide data grids with php short
of simply creating a bunch of input boxes or using flash?
[/snip]

Have you looked at GTK? http://gtk.php.net

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



RE: [PHP] What's faster? MySQL Queries or PHP Loops?

2004-09-08 Thread Jay Blanchard
[snip]
That brings up another question which I know actually belongs over on
the MySQL board, but since the question arose here I thought I'd post
here. I understood that MyISAM tables could not be relational. Do you
mean that I can create JOINs between MyISAM tables? Maybe I need to do
some more research into table types?
[/snip]

MyISAMs can be JOINED, but there are no true primary key and foreign key
constraints.

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



Re: [PHP] What's faster? MySQL Queries or PHP Loops?

2004-09-08 Thread John Holmes
From: "Robb Kerr" <[EMAIL PROTECTED]>
That brings up another question which I know actually belongs over on the
MySQL board, but since the question arose here I thought I'd post here. I
understood that MyISAM tables could not be relational. Do you mean that I
can create JOINs between MyISAM tables? Maybe I need to do some more
research into table types?
Yes, you can do JOINs between MyISAM tables. You can just not enforce 
referential integrity between MyISAM tables from within the database.

---John Holmes... 

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


Re: [PHP] Re: imap_open() on windows extremely slow?

2004-09-08 Thread Michael Sims
Michael Wallner wrote:

> Well, so here comes /the oddity/
> 
> connecting from debian to windows/exchange ~0.5 seconds
> connecting from debian to debian/courier ~0.2 (assumed to be somewhere at 0.x 
> seconds)
> connecting from windows to debian/courier ~5 seconds
> connecting from windows to windows/exchange ~0.5 seconds
> 
> Half a second is what I'd expect and is acceptable, but
> 5 seconds seems to be more serious than an oddity...

Anytime I see something like this, I suspect that the server (in this
case, Courier IMAP) is attempting an ident lookup on the client, or is
attempting a reverse DNS lookup.  I suspect the latter is more likely.
For kicks, try temporarily adding an entry for your windows client to
the /etc/hosts file on the Debian/Courier server.  If that fixes the
problem then I would look for ways to disable reverse DNS lookups in
Courier.  Just a thought...

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



Re: [PHP] What's faster? MySQL Queries or PHP Loops?

2004-09-08 Thread Greg Donald
On Wed, 2004-09-08 at 13:31, Robb Kerr wrote:
> That brings up another question which I know actually belongs over on the
> MySQL board, but since the question arose here I thought I'd post here. I
> understood that MyISAM tables could not be relational. Do you mean that I
> can create JOINs between MyISAM tables? Maybe I need to do some more
> research into table types?

Yes, more research.

Maybe you're confusing relational with transactional.


-- 
Greg Donald

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



[PHP] Re: Auth class----MySQL user

2004-09-08 Thread Philipp Wendisch
Pahlevanzadeh Mohsen wrote:
Dears,My code is :

  echo "xxx";
  echo "";
  echo " ";
  echo " ";
  echo "";
  echo "";
 }
 $username=$_POST['u'];
 $password=$_POST['p'];
 echo md5('mohsen');
$parameterforauth=array("dsn"=>"mysql://$username:[EMAIL PROTECTED]/mem",
 "table"=>"usernames",
 "usernamecol"=>"user",
 "passwordcol"=>"pass");
 $ptr_auth_C=new Auth("DB",$parameterforauth,'Login');
 $ptr_auth_C->start();
 if ($ptr_auth_C->getAuth())
   echo "Successfuly loggined!!!";
?>
I have opened mysql shell,& i have typed following
statement:
use mem
grant all privileges on usernames to [EMAIL PROTECTED];
set password for mohsen=password('loverx');
insert into usernames values
(user='mohsen',pass=md5('loverx'));
commit;
But i can't loggin into my program.(with mohsen as
username & loverx as password)
Thsu i can't see "Successfuly loggined!!!"
Please guide me.
Yours,Mohsen.

=
-DIGITAL  SIGNATURE---
///Mohsen Pahlevanzadeh
 Network administrator  & programmer 
  My home phone is: +98213810146  
My email address is  
  m_pahlevanzadeh at yahoo dot com   
My website is: http://webnegar.net


simple answer:
read the manual about Auth, and you will notice the warning:
You can change all the HTML formatting in the function, but you cannot change 
the names of the input boxes in the form. They have to be username and password.

after changing the names, you will see, that it works ;-)
greets
Philipp
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


[PHP] Re: imap_open() on windows extremely slow?

2004-09-08 Thread Michael Wallner
Hi Michael Sims, you wrote:

> Anytime I see something like this, I suspect that the server (in this
> case, Courier IMAP) is attempting an ident lookup on the client, or
> is attempting a reverse DNS lookup.

Well, Courier did already run with -nodnslookup -noidentlookup.
It seems that it is waiting for a client bucket while select()'ing,
you can see the relevant traces and tcpdumps here:
http://s1-iw.iworks.at/ext.imap.txt

Thanks,
-- 
Michael - < mike(@)php.net >


signature.asc
Description: OpenPGP digital signature


Re: [PHP] Users of RDBMS

2004-09-08 Thread Victor Saldaña D.
On Wed, 8 Sep 2004 12:01:55 -0700 (PDT), Pahlevanzadeh Mohsen
<[EMAIL PROTECTED]> wrote:
> Dears,
> I need to create user for MySQL.
> Please guide me..

Please RTFM

http://dev.mysql.com/doc/mysql/en/Adding_users.html

--
Victor Saldaña D.

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



Re: [PHP] Users of RDBMS

2004-09-08 Thread John Holmes
From: "Pahlevanzadeh Mohsen" <[EMAIL PROTECTED]>
I need to create user for MySQL.
Please guide me..
PHP != MySQL
http://dev.mysql.com/doc/mysql/en/index.html
---John Holmes...
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


Re: [PHP] data grids...

2004-09-08 Thread blackwater dev
yeah, it needs to be on a front end site where the users can enter
their data easily...I will play with the new flash data grid component
some more.

Thanks!


On Wed, 8 Sep 2004 15:06:55 -0400, John Holmes <[EMAIL PROTECTED]> wrote:
> From: "blackwater dev" <[EMAIL PROTECTED]>
> 
> 
> 
> > Does anyone have a nice clean way to provide data grids with php short
> > of simply creating a bunch of input boxes or using flash?
> 
> You mean using HTML/DHTML/CSS, etc. instead of PHP. PHP just creates the
> code to send to the browser.
> 
> To answer your question, though, if you're stuck with HTML, then the "bunch
> of textboxes" is your only option. Flash is probably your best bet if you
> want a true grid or maybe some ActiveX/Java plug in?
> 
> ---John Holmes...
> 
>

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



RE: [PHP] Users of RDBMS

2004-09-08 Thread Jay Blanchard
[snip]
I need to create user for MySQL.
Please guide me..
[/snip]

I will guide you to the MySQL lists at http://lists.mysql.com/

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



RE: [PHP] data grids...

2004-09-08 Thread Jay Blanchard
[snip]
What is a 'data grid' ?
[/snip]

Like a spreadsheet where you can manuever from cell to cell.

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



Re: [PHP] Users of RDBMS

2004-09-08 Thread Greg Donald
On Wed, 2004-09-08 at 14:01, Pahlevanzadeh Mohsen wrote:
> Dears,
> I need to create user for MySQL.
> Please guide me..


http://dev.mysql.com/doc/mysql/en/Adding_users.html


-- 
Greg Donald

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



Re: [PHP] What's faster? MySQL Queries or PHP Loops? OT

2004-09-08 Thread Jim Grill
> That brings up another question which I know actually belongs over on the
> MySQL board, but since the question arose here I thought I'd post here. I
> understood that MyISAM tables could not be relational. Do you mean that I
> can create JOINs between MyISAM tables? Maybe I need to do some more
> research into table types?
> -- 
> Robb Kerr
> Digital IGUANA
> Helping Digital Artists Achieve their Dreams
> 
> http://www.digitaliguana.com
> http://www.cancerreallysucks.org
>
What the heck... I'll go for it OT.

While MyISAM tables do not natively support foreign key constraints, this
has nothing to do with joined queries that is to select data from
multiple tables or even multiple databases in one query.

For a really cool tutorial see:
http://www.devshed.com/c/a/MySQL/Understanding-SQL-Joins/

Have fun,

Jim Grill

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



Re: [PHP] Users of RDBMS

2004-09-08 Thread Jim Grill
> Dears,
> I need to create user for MySQL.
> Please guide me..
> 
> =
> -DIGITAL  SIGNATURE---
> ///Mohsen Pahlevanzadeh
>  Network administrator  & programmer 
>   My home phone is: +98213810146  
> My email address is  
>   m_pahlevanzadeh at yahoo dot com   
> My website is: http://webnegar.net
> 
> 
Dear,

Please go here: http://lists.mysql.com/

Jim Grill

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



Re: [PHP] Users of RDBMS

2004-09-08 Thread Joshua D. Drake
> PHP != MySQL

MySQL != RDBMS

http://www.postgresql.org


> 
> http://dev.mysql.com/doc/mysql/en/index.html
> 
> ---John Holmes...
> 
> 

-- 
Co-Founder
Command Prompt, Inc.
The wheel's spinning but the hamster's dead

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



Re: [PHP] Users of RDBMS

2004-09-08 Thread John Nichel
Pahlevanzadeh Mohsen wrote:
Dears,
I need to create user for MySQL.
Please guide me..
I keep forgetting that this it the MySQL list.
--
John C. Nichel
ÜberGeek
KegWorks.com
716.856.9675
[EMAIL PROTECTED]
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


RE: [PHP] Users of RDBMS

2004-09-08 Thread Dan Joseph


> -Original Message-
> From: Jay Blanchard [mailto:[EMAIL PROTECTED]
> Sent: Wednesday, September 08, 2004 3:37 PM
> To: Pahlevanzadeh Mohsen; [EMAIL PROTECTED]
> Subject: RE: [PHP] Users of RDBMS
> 
> [snip]
> I need to create user for MySQL.
> Please guide me..
> [/snip]
> 
> I will guide you to the MySQL lists at http://lists.mysql.com/
> 
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php

I should share this image I found...



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

RE: [PHP] Users of RDBMS

2004-09-08 Thread Dan Joseph
Hi,

> PHP != MySQL
> 
> http://dev.mysql.com/doc/mysql/en/index.html

Shouldn't that be:

if ( PHP != MySQL )
{
Header( "Location:
http://dev.mysql.com/doc/mysql/en/index.html"; );
}

-Dan Joseph

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



[PHP] Timing on an internal email

2004-09-08 Thread Alex Hogan
Hi all,

I want to set up a delivery date and time for emails to be sent. (I'm
using phpmailer)

I'm coming up blank on how to do this.  I thought that I could put a
timing condition on a page that I know will be accessed daily that
would look for the date then call the function that will do the mail
outs on the appropriate date, but there has to be a better way.

Is this something that I'll have to do outside of php?


alex hogan

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



[PHP] Lambert's Projection and PHP

2004-09-08 Thread Ville Mattila
Hello,
I'm working with a system that draws a map from certain information. 
Lambert's projection seems to suit well to our needs.

Now I should generate a function that converts the lat/lon coordinates 
to the x,y coordinates using the Lambert's projection. As I couldn't 
find any ready-to-use script, I decided to write it from scratch... 
Well, no results at the moment. ;)

I found a formula explaining the projection at 
http://mathworld.wolfram.com/LambertConformalConicProjection.html . 
Unfortunately there is no explanation that what units x and y are, so 
drawing them or further convertion is impossible.

Now I would appreciate your help with this case. Any help is 
appreciated! Scripts, formulaes and other stuff give valuable help for 
the project.

Thank you!
Ville Mattila
Ikaalinen, Finland
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


Re: [PHP] Users of RDBMS

2004-09-08 Thread John Nichel
Joshua D. Drake wrote:
PHP != MySQL

MySQL != RDBMS
Please tell me you're kidding.
--
John C. Nichel
ÜberGeek
KegWorks.com
716.856.9675
[EMAIL PROTECTED]
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


Re: [PHP] Users of RDBMS

2004-09-08 Thread M. Sokolewicz
John Nichel wrote:
Joshua D. Drake wrote:
PHP != MySQL

MySQL != RDBMS

Please tell me you're kidding.
that's a funny one... could've sworn it actually was one...
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


[PHP] Re: Timing on an internal email

2004-09-08 Thread Sean Smith
You can have the php script written so that it performs the functions 
you want then setup a cron job to run that script at a given time or 
interval. I do this with daily and weekly operations now. It works great.

Alex Hogan wrote:
Hi all,
I want to set up a delivery date and time for emails to be sent. (I'm
using phpmailer)
I'm coming up blank on how to do this.  I thought that I could put a
timing condition on a page that I know will be accessed daily that
would look for the date then call the function that will do the mail
outs on the appropriate date, but there has to be a better way.
Is this something that I'll have to do outside of php?
alex hogan
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


Re: [PHP] Timing on an internal email

2004-09-08 Thread Marek Kilimajer
Alex Hogan wrote:
Hi all,
I want to set up a delivery date and time for emails to be sent. (I'm
using phpmailer)
I'm coming up blank on how to do this.  I thought that I could put a
timing condition on a page that I know will be accessed daily that
would look for the date then call the function that will do the mail
outs on the appropriate date, but there has to be a better way.
Sure.
Is this something that I'll have to do outside of php?
Not necessarily outside of php, but outside of webserver. You need to 
setup a cron job that will execute the phpmailer script.

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


Re: [PHP] Timing on an internal email

2004-09-08 Thread Alex Hogan
> Not necessarily outside of php, but outside of webserver. You need to
> setup a cron job that will execute the phpmailer script.

Gotcha..,

My webserver is a windows box, so I can just run a task schedule and give it;
php.exe myfile.php
and that should do it?

Would it be more efficient as a command line task or as an instance of
the browser?



alex hogan

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



[PHP] htmlentities()

2004-09-08 Thread Anthony Ritter
Copied and pasted the following sample script from the php manual and this
outputs:

...
bold";
echo htmlentities($str);

?>
..

// outputs: A 'quote' is bold

Not sure why the I am still getting the tags and spaces after the call to
htmlentities().

Thank you for any help.
TR

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



[PHP] Tidy installation problem in php 4.3.8

2004-09-08 Thread Lizet Peña de Sola
Hi all,
I need to use tidy for cleaning up html in my project, our hosting company
has php 4.3.8, so we need to install tidy and make the installation again.
After several times, the configure and make commands replied no error,
however, the phpinfo() doesn't show the package as installed and when we run
the function ini_set() to set the tidy constants in the php.ini file, it
returns nothing, also any call to the tidy library functions gives
error...any ideas of why this isn't working? After a succesfull
installation, is there any enviroment constant we can check or should set?
Thanks a lot in advance, 
Lizet

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



Re: [PHP] Lambert's Projection and PHP

2004-09-08 Thread Michal Migurski
> I'm working with a system that draws a map from certain information.
> Lambert's projection seems to suit well to our needs.

...

> I found a formula explaining the projection at
> http://mathworld.wolfram.com/LambertConformalConicProjection.html .
> Unfortunately there is no explanation that what units x and y are, so
> drawing them or further conversion is impossible.

x and y are the Cartesian coordinates on the projected map.
To be useful, they generally need to be scaled, translated, and rotated to
the particular dimensions of the map you wish to output.

I have a small library of classes which implement albers conical equal
are, lambert azimuthal equal area, and lambert conformal conic
projections here:
http://mike.teczno.com/map-code.tar

Those files are the beginnings of something I am planning to contribute to
the PEAR project, so if anyone has feedback or other projects they wish to
see added, they are very welcome.

See the test/lambert_conformal_conic.php file for an example of usage and
a brief unit test. Note that the reference latitude & longitude and the
standard parallels described in the mathworld write-up are the four
arguments to the constructor, and that all lat/long units are expected in
radian, not degrees. Sorry that the comments aren't as extensive as they
ought to be.

-
michal migurski- contact info and pgp key:
sf/cahttp://mike.teczno.com/contact.html

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



Re: [PHP] htmlentities()

2004-09-08 Thread Chris Shiflett
--- Anthony Ritter <[EMAIL PROTECTED]> wrote:
> Copied and pasted the following sample script from the php manual
> and this outputs:
> 
> ...
>  $str = "A 'quote' is bold";
> echo htmlentities($str);
> 
> ?>
> ..
> 
> // outputs: A 'quote' is bold
> 
> Not sure why the I am still getting the tags and spaces after
> the call to htmlentities().

View source, and I think you'll understand. Or, remove the call to
htmlentities().

Chris

=
Chris Shiflett - http://shiflett.org/

PHP Security - O'Reilly
 Coming Fall 2004
HTTP Developer's Handbook - Sams
 http://httphandbook.org/
PHP Community Site
 http://phpcommunity.org/

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



Re: [PHP] htmlentities()

2004-09-08 Thread Jim Grill
> Copied and pasted the following sample script from the php manual and this
> outputs:
>
> ...
>  $str = "A 'quote' is bold";
> echo htmlentities($str);
>
> ?>
> ..
>
> // outputs: A 'quote' is bold
>
> Not sure why the I am still getting the tags and spaces after the call to
> htmlentities().
>
> Thank you for any help.
> TR


Are you looking at the html source?? I get A 'quote' is bold when I
load the page *BUT* viewing the source gives me this: A 'quote' is
bold

;-)

Jim Grill

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



Re: [PHP] htmlentities()

2004-09-08 Thread Jim Grill
> Copied and pasted the following sample script from the php manual and this
> outputs:
>
> ...
>  $str = "A 'quote' is bold";
> echo htmlentities($str);
>
> ?>
> ..
>
> // outputs: A 'quote' is bold
>
> Not sure why the I am still getting the tags and spaces after the call to
> htmlentities().
>
> Thank you for any help.
> TR
>

Sorry to spam you, but If you are wanting to remove html altogether take
a look at strip_tags()
http://us4.php.net/manual/en/function.strip-tags.php

Jim Grill

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



[PHP] Re: htmlentities()

2004-09-08 Thread Paul Birnstihl
Anthony Ritter wrote:
bold";
echo htmlentities($str);
?>
..
// outputs: A 'quote' is bold
Not sure why the I am still getting the tags and spaces after the call to
htmlentities().
Check out the source code of the output. Maybe you want the strip_tags() 
function ?

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


Re: [PHP] htmlentities()

2004-09-08 Thread Anthony Ritter
Chris Shiflett wrote:

> View source, and I think you'll understand. Or, remove the call to
> htmlentities().
>
> Chris
..

Thank you all for your assistance.

Best...
TR
...

"...when a browser sees  <, it prints out a < character instead of
thinking "OK here comes an HTML tag."  This is the same idea (but with a
differnt syntax) as escaping a " or $ charcater inside a double quoted
string..." ~[from Learning PHP5 [O'Reilly] page 102]



love sweet tea and rice. &
tea\n";
echo $str;
echo "";
echo htmlentities($str);
?>

// Output in view source code:

I love sweet tea and rice. & tea
I love sweet tea and 
rice.
& tea -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php

Re: [PHP] Re: Convert Smart Quotes to Sraight Quotes - Need Help!

2004-09-08 Thread Tom Rogers
Hi,

Wednesday, September 8, 2004, 9:14:53 AM, you wrote:
M> Anyone! I'm out of online resources and answers. I guess this isn't possible
M> to do...

Here is a function/hack I use to clean up text for my php-gtk editor,
I still haven't found a clean solution yet but it may help.


function convert_text(&$text,&$content){
$count = 0;
$content = '';
$changed = false;
for($i=0,$length=strlen($text);$i<$length;$i++){
  //echo ord($text[$i])."\n";
  //echo $text[$i]."\n\n";
  if(ord($text[$i]) > 193 && ord($text[$i]) < 224){
if(ord($text[$i+1]) > 127 && ord($text[$i+1]) < 192){
  $changed = true;
  //echo "found 2 byte control code ".ord($text[$i])." ".ord($text[$i+1]);
  $str = $text[$i].$text[$i+1];
  $rep = htmlentities($str,ENT_QUOTES,'UTF-8');
  if(!empty($rep) && $str !== $rep){
$content .= $rep;
//echo " success-$rep-$rep2-$str\n";
  }else{
$content .= '?';
//echo " failed-$rep2-$str\n";
  }
  $i += 1;
}else{
  $content .= $text[$i];
  echo "Oddball 2 byte ".ord($text[$i])." ".ord($text[$i+1])."\n";
}
  }
  elseif(ord($text[$i]) > 223 && ord($text[$i]) < 240){ 
if(ord($text[$i+1]) > 127 && ord($text[$i+1]) < 192){
  if(ord($text[$i+2]) > 127 && ord($text[$i+2]) < 192){
$changed = true;
//echo "found 3 byte control code ".ord($text[$i])." ".ord($text[$i+1])." 
".ord($text[$i+2]);
$str = $text[$i].$text[$i+1].$text[$i+2];
$rep = htmlentities($str,ENT_QUOTES,'UTF-8');
if(!empty($rep) && $str !== $rep){
  $content .= $rep;
  //echo " success-$rep-\n";
}else{
  $content .= '?';
  //echo " failed\n";
}
$i += 2;
  }else{
$content .= $text[$i];
echo "Oddball 3 byte-3 ".ord($text[$i])." ".ord($text[$i+1])." 
".ord($text[$i+2])."\n";
  }
}else{
  $content .= $text[$i];
  echo "Oddball 3 byte-2 ".ord($text[$i])." ".ord($text[$i+1])." 
".ord($text[$i+2])."\n";
}
  }else{
$content .= $text[$i];
  }
}
return $changed;
  }
  //Usage
  $text = "String with quotes";   //original
  $content = '';//result

  if(convert_text($text,$content)){
echo $content;
  }else{
echo $text;
  }

-- 
regards,
Tom

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



Re: [PHP] Users of RDBMS

2004-09-08 Thread John Nichel
M. Sokolewicz wrote:
John Nichel wrote:
Joshua D. Drake wrote:
PHP != MySQL


MySQL != RDBMS

Please tell me you're kidding.
that's a funny one... could've sworn it actually was one...
All this time the MySQL AB people have been lying to us.  It's actually 
an Excel spreadsheet. ;)

--
By-Tor.com
It's all about the Rush
http://www.by-tor.com
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


Re: [PHP] Users of RDBMS

2004-09-08 Thread Greg Donald
On Wed, 8 Sep 2004 13:14:57 -0700 (PDT), Joshua D. Drake
<[EMAIL PROTECTED]> wrote:
> MySQL != RDBMS
> 
> http://www.postgresql.org

Yup.

I recently became a Postgres user after 5+ years using MySQL.  I am
very impressed with it so far.  The price is right and the license is
very friendly for all.


-- 
Greg Donald
http://destiney.com/

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



[PHP] Re: data grids...

2004-09-08 Thread Aidan Lister
http://pear.php.net/package/Structures_DataGrid


"Blackwater Dev" <[EMAIL PROTECTED]> wrote in message 
news:[EMAIL PROTECTED]
> Does anyone have a nice clean way to provide data grids with php short
> of simply creating a bunch of input boxes or using flash?
>
> Thanks! 

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



Re: [PHP] data grids...

2004-09-08 Thread Brent Clements
This is what I've used in the past, it's pretty much compatible with all of
the major browsers that users will use.

http://www.activewidgets.com/

-Brent

- Original Message - 
From: "blackwater dev" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Wednesday, September 08, 2004 1:15 PM
Subject: [PHP] data grids...


> Does anyone have a nice clean way to provide data grids with php short
> of simply creating a bunch of input boxes or using flash?
>
> Thanks!
>
> -- 
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>
>

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



[PHP] Explode, Arrays and Checkboxes

2004-09-08 Thread Matt Winslow
I'm not new to PHP, but I have very little experience with arrays.  I have comma 
separated values in a database, that I need to pull out, explode into an array, then 
check certain checkboxes if they exist.

I have two variables:

$x = "2,10,34"
$y = "28,15,16"

I need to explode them both, so that the values of $x are they keys, and the values of 
$y are the values.  Is that possible?

I have a form, with checkboxes that are named $product[1] through [40].  Next to them 
are textboxes labeled $price[1] through [40].  How would make the form, when it loads, 
have $product[2], [10], [34] checked, with $price[2], [10], and [34] equal to "28", 
"15", and "16" respecively.

Any help would be greatly appreciated.

-- 
Matt Winslow
[EMAIL PROTECTED]

Re: [PHP] Explode, Arrays and Checkboxes

2004-09-08 Thread zareef ahmed
HI,

--- Matt Winslow <[EMAIL PROTECTED]> wrote:

> I'm not new to PHP, but I have very little
> experience with arrays.  I have comma separated
> values in a database, that I need to pull out,
> explode into an array, then check certain checkboxes
> if they exist.
> 
> I have two variables:
> 
> $x = "2,10,34"
> $y = "28,15,16"
> 
> I need to explode them both, so that the values of
> $x are they keys, and the values of $y are the
> values.  Is that possible?

yes see array_combine function

http://www.php.net/array_combine


> I have a form, with checkboxes that are named
> $product[1] through [40].  Next to them are
> textboxes labeled $price[1] through [40].  How would
> make the form, when it loads, have $product[2],
> [10], [34] checked, with $price[2], [10], and [34]
> equal to "28", "15", and "16" respecively.

a sensible use of foreach and if can easily do so.

zareef ahmed

=
Homepage :: http://www.zasaifi.com



___
Do you Yahoo!?
Win 1 of 4,000 free domain names from Yahoo! Enter now.
http://promotions.yahoo.com/goldrush

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



Re: [PHP] Explode, Arrays and Checkboxes

2004-09-08 Thread Curt Zirzow
* Thus wrote Matt Winslow:
> I'm not new to PHP, but I have very little experience with arrays.  I have comma 
> separated values in a database, that I need to pull out, explode into an array, then 
> check certain checkboxes if they exist.
> 
> I have two variables:
> 
> $x = "2,10,34"
> $y = "28,15,16"
> 
> I need to explode them both, so that the values of $x are they keys, and the values 
> of $y are the values.  Is that possible?

$final = array();
$Y = explode(',', $y);

foreach(explode(',', $x) as $key => $val ) {
  $final[$val] = $Y[$key];
}

var_dump($final);

> 
> I have a form, with checkboxes that are named $product[1] through [40].  Next to 
> them are textboxes labeled $price[1] through [40].  How would make the form, when it 
> loads, have $product[2], [10], [34] checked, with $price[2], [10], and [34] equal to 
> "28", "15", and "16" respecively.
> 

What is the relationship between the $x,$y and $product,$price?
I'm not sure I quite grasp what your trying to do.

If I understand correctly, the situation you describe ends up not
being a one-one relationship. So a user could select 4 prices with
3 products or vice versa. Which will make things difficult to match
up products/prices.


Curt
-- 
The above comments may offend you. flame at will.

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



Re: [PHP] Explode, Arrays and Checkboxes

2004-09-08 Thread Curt Zirzow
* Thus wrote zareef ahmed:
> HI,
> 
> > 
> > I have two variables:
> > 
> > $x = "2,10,34"
> > $y = "28,15,16"
> > 
> > I need to explode them both, so that the values of
> > $x are they keys, and the values of $y are the
> > values.  Is that possible?
> 
> yes see array_combine function
> 
> http://www.php.net/array_combine

heh.. there are so many array_* functions i forgot about that one.
Sometimes that array documentation can be so overwhelming.


Curt
-- 
The above comments may offend you. flame at will.

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



[PHP] why should $_SESSION be slower than other arrays?

2004-09-08 Thread Aaron Voisine
I read in the docs several comments that $_SESSION is slower that other
arrays. One
comment even had benchmarking info indicating it was about half as
fast. I don't understand
why this should be. Isn't $_SESSION just a normal super global array
like any other, except 
that it get serialized and written to disk *once at the end* of a
request? Why on earth would this impact the performance of reading and
writing in the middle of a request? Is there some
funkyness going on under the covers that I'm missing? Can it be made to
work as I 
described?

l8r
Aaron



__
Do you Yahoo!?
New and Improved Yahoo! Mail - Send 10MB messages!
http://promotions.yahoo.com/new_mail 

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



[PHP] Re: data grids...

2004-09-08 Thread Nadim Attari
BlueShoes: PHP Framework and CMS
http://www.blueshoes.org/en/javascript/

Regards,
Nadim Attari
Alienworkers.com


"Blackwater Dev" <[EMAIL PROTECTED]> a écrit dans le message de
news:[EMAIL PROTECTED]
> Does anyone have a nice clean way to provide data grids with php short
> of simply creating a bunch of input boxes or using flash?
>
> Thanks!

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