Re: [PHP] question about corrupt db?

2008-12-02 Thread Ashley Sheridan
On Tue, 2008-12-02 at 01:14 +, Nathan Rixham wrote: Ashley Sheridan wrote: On Mon, 2008-12-01 at 16:29 -0600, Terion Miller wrote: On Mon, Dec 1, 2008 at 4:20 PM, Ashley Sheridan [EMAIL PROTECTED] wrote: On Mon, 2008-12-01 at 15:53 -0600, Terion Miller wrote:

Re: [PHP] Countries and Timezones

2008-12-02 Thread Per Jessen
franzemmanuel wrote: Hi everybody, For those who are interested in Countries and timezones. I needed to have the list of all the countries in the world and the timezones by country without redundancy. Couldn't you just have use the timezone info from mysql? /Per Jessen, Zürich --

Re: [PHP] category and sub category traversal

2008-12-02 Thread Richard Heyes
I need some help in figuring out this logic. I have two tables one for category and other for category_hierarchy. category_hirerarchy has a column to determine the parent. So the query I have to retrieve tree of one specific category is: SELECT t.tid, t.*, parent FROM term_data t INNER

[PHP] Short circuit evaluation and include

2008-12-02 Thread Yeti
Hello everyone, I'm posting this as a warning when using include() or include_once() and checking their return values. I'm refactoring someone else's code at the moment and got a short circuit evaluation problem that made some problems .. Here's the code: FILE some_file.php: ?php function

Re: [PHP] array_intersect question

2008-12-02 Thread Tim | iHostNZ
I know there must be a more elegant way with array_reduce or something, but I would simply write a function called function array_intersect_m($m_array) { $intersection = $m_array[0]; for ($i=1; $i count($m_array); $i++) { $intersection = array_intersect($m_array[$i], $intersection); }

[PHP] category and sub category traversal

2008-12-02 Thread ceo
Google for SELF JOIN You also may want to just put the parent_id in the category table, rather than a second table. Your query would then look like this: select parent.tid, child.tid from term_data as parent, term_data as child where child.parent_id = parent.tid and child.vid = 16

[PHP] array_intersect question

2008-12-02 Thread Andrej Kastrin
Dear all, I have to perform an intersection on array of arrays. The fact is that php does not support intersection on multidimensional arrays. So, the first simple example using only one dimensional arrays works well: $array1 = array(green, red, blue); $array2 = array(green, yellow, red);

Re: [PHP] How to hide MySQL password in connection string in PHP script?

2008-12-02 Thread ceo
On a shared server, you rarely can really protect your MySQL user/pass from other users on the same server. The problem is that your PHP process is probably an Apache module, and you probably don't have your own separate pool of Apache User processes. So, by definition, if YOUR script can

Re: [PHP] XML RSS installation

2008-12-02 Thread ceo
htdocs -- This the document root of your website pear + HTML + Mail + Net If you're going to set your include path properly, you might as well not put PEAR in htdocs, since none of those files are front-facing URLs that should be visited by an end user. They belong in a non web root

Re: [PHP] How to hide MySQL password in connection string in PHP script?

2008-12-02 Thread Yeti
Robert Dodier robert_dodier AT yahoo.com wrote on 12-21-2003 Hello, I am experimenting with a wiki system (PhpWiki) which uses a MySQL database to store pages. It seems like a great system. The MySQL connection string is specified in a PHP script in the form mysql://FOO:[EMAIL

Re: [PHP] Short circuit evaluation and include

2008-12-02 Thread ceo
include and require are not functions. They are language constructs. They probably don't return values nor short-circuit in the usual way. Ditto for echo If you can strip the parens and have it still work, it's for sure not a function. ?php include_once $file; echo $file; ?

Re: [PHP] array_intersect question

2008-12-02 Thread Andrej Kastrin
It works like a charm. Thanks, Andrej Tim | iHostNZ wrote: I know there must be a more elegant way with array_reduce or something, but I would simply write a function called function array_intersect_m($m_array) { $intersection = $m_array[0]; for ($i=1; $i count($m_array); $i++) {

Re: [PHP] XML RSS installation

2008-12-02 Thread Richard Heyes
What do you mean by replicating the directory structure? PEAR has a directory structure. Duplicate it and set you include_path accordingly. Have a look at the application structure on article my website ( http://www.phpguru.org ) - it may be of some help. Eg: htdocs -- This the document root

[PHP] Re: Voting methodology

2008-12-02 Thread Al
Shawn McKenzie wrote: tedd wrote: Hi gang: What methodology would be the best for online voting? I have a client who is a Union and they want members to vote online, but don't want someone to stuff the voting box. I have some ideas of my own, but would like to hear what you people would

Re: [PHP] array_intersect question

2008-12-02 Thread Yeti
The question is how to perform intersection on the following structure: $products = array(array(green,red,blue),array(green,yellow,red),array(green,red,purple),array(green,red,yellow)); If I understood you correctly .. ?php $arr = array(); $arr[] = array(green, red, blue); $arr[] =

Re: [PHP] XML RSS installation

2008-12-02 Thread Richard Heyes
htdocs -- This the document root of your website pear + HTML + Mail + Net That's not what I wrote: htdocs -- This the document root of your website pear + HTML + Mail + Net -- Richard Heyes HTML5 Graphing for FF, Chrome, Opera and Safari: http://www.rgraph.org (Updated November 29th)

Re: [PHP] question about corrupt db?

2008-12-02 Thread uaca man
To view the logs in IIS you must go to the root web site in the IIS Snap in, virtual folders, folders and applications don't have a separate log file. In the left panel in the snap in, right click in the site, probably default web site, click on properties, look for a tab called 'Web Site', in the

[PHP] How to type arguments

2008-12-02 Thread Gautier Di Folco
Hello, I'm a french student, sorry for my mail : I want to know how can I type my functions' arguments ? It is heavy to do : function post($id) { $id=(int)$id; //... or tu put (int) before each use... Thank you for your help

Re: [PHP] XML RSS installation

2008-12-02 Thread Richard Heyes
I apologize for the misunderstanding. That's OK, I forgive you my child. :-) -- Richard Heyes HTML5 Graphing for FF, Chrome, Opera and Safari: http://www.rgraph.org (Updated November 29th) -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php

Re: [PHP] XML RSS installation

2008-12-02 Thread ceo
htdocs -- This the document root of your website pear + HTML + Mail + Net That's not what I wrote: htdocs -- This the document root of your website pear + HTML + Mail + Net I apologize for the misunderstanding. -- PHP General Mailing List (http://www.php.net/) To

Re: [PHP] How to type arguments

2008-12-02 Thread Richard Heyes
I'm a french student, sorry for my mail : I want to know how can I type my functions' arguments ? It is heavy to do : function post($id) { $id=(int)$id; //... PHP is loosely typed so strictly (...) speaking, that would be fine. However, you're best off making sure that what you've been

[PHP] Slow file download

2008-12-02 Thread Brian Dunning
I'm using a PHP cron job to constantly download files from a remote server. Client and server both have abundant unused bandwidth, and the sysads have already eliminated switches, interface cards, etc. as the source of the slowdown. I'm looking at the script to see why file downloads are

Re: [PHP] Slow file download

2008-12-02 Thread Ashley Sheridan
On Tue, 2008-12-02 at 11:55 -0800, Brian Dunning wrote: I'm using a PHP cron job to constantly download files from a remote server. Client and server both have abundant unused bandwidth, and the sysads have already eliminated switches, interface cards, etc. as the source of the slowdown.

Re: [PHP] Slow file download

2008-12-02 Thread Brian Dunning
I'm open to something like that - we're in the middle of the holiday crunch and can't afford any downtime, so a significant change is out of the question. This is part of much larger and more involved scripting, so it would need to be a plug-n-play replacement and also be able to return

Re: [PHP] Slow file download

2008-12-02 Thread Ashley Sheridan
On Tue, 2008-12-02 at 12:14 -0800, Brian Dunning wrote: I'm open to something like that - we're in the middle of the holiday crunch and can't afford any downtime, so a significant change is out of the question. This is part of much larger and more involved scripting, so it would need to

[PHP] why this code needs mysql.sock instead of mysqld.sock

2008-12-02 Thread ann kok
Hi all     ?php $link=mysql_connect('localhost','usrname','password'); if(!$link) echo fail; else echo success; mysql_close(); ?   Thank you __ Connect with friends from any web browser - no download required. Try the new

[PHP] Re: Slow file download

2008-12-02 Thread Nathan Rixham
Brian Dunning wrote: I'm using a PHP cron job to constantly download files from a remote server. Client and server both have abundant unused bandwidth, and the sysads have already eliminated switches, interface cards, etc. as the source of the slowdown. I'm looking at the script to see why

Re: [PHP] why this code needs mysql.sock instead of mysqld.sock

2008-12-02 Thread Stut
On 2 Dec 2008, at 20:15, ann kok wrote: ?php $link=mysql_connect('localhost','usrname','password'); if(!$link) echo fail; else echo success; mysql_close(); ? The location of the socket is compiled into the mysql lib. I believe it can be changed from php.ini - check the manual for details. If

Re: [PHP] How to type arguments

2008-12-02 Thread Nathan Rixham
Richard Heyes wrote: I'm a french student, sorry for my mail : I want to know how can I type my functions' arguments ? It is heavy to do : function post($id) { $id=(int)$id; //... PHP is loosely typed so strictly (...) speaking, that would be fine. However, you're best off making sure that

Re: [PHP] Re: Slow file download

2008-12-02 Thread Brian Dunning
IIS, Windows PHP 5.2.6, and unfortunately the downloads are https. On Dec 2, 2008, at 12:32 PM, Nathan Rixham wrote: what's the server running? iis/apache, win/linux version of php (as accurate as you can) oh and via http or https/ssl? -- PHP General Mailing List (http://www.php.net/) To

Re: [PHP] Slow file download

2008-12-02 Thread ceo
If the files are LARGE, file_get_contents is a Bad Idea (tm). You're trying to suck the whole thing into RAM, which it can't, which swaps and thrashes the bleep out of your RAM/swap space... Use fopen and an fread loop instead, and you'll probably see much better performance. Also,

Re: [PHP] Re: Slow file download

2008-12-02 Thread Nathan Rixham
Brian Dunning wrote: IIS, Windows PHP 5.2.6, and unfortunately the downloads are https. On Dec 2, 2008, at 12:32 PM, Nathan Rixham wrote: what's the server running? iis/apache, win/linux version of php (as accurate as you can) oh and via http or https/ssl? now I may be wrong but I'm rather

Re: [PHP] Re: Slow file download

2008-12-02 Thread Nathan Rixham
Nathan Rixham wrote: Brian Dunning wrote: IIS, Windows PHP 5.2.6, and unfortunately the downloads are https. On Dec 2, 2008, at 12:32 PM, Nathan Rixham wrote: what's the server running? iis/apache, win/linux version of php (as accurate as you can) oh and via http or https/ssl? now I may be

Re: [PHP] Re: Slow file download

2008-12-02 Thread Ashley Sheridan
On Tue, 2008-12-02 at 21:10 +, Nathan Rixham wrote: Brian Dunning wrote: IIS, Windows PHP 5.2.6, and unfortunately the downloads are https. On Dec 2, 2008, at 12:32 PM, Nathan Rixham wrote: what's the server running? iis/apache, win/linux version of php (as accurate as you can)

Re: [PHP] Re: Slow file download

2008-12-02 Thread Ashley Sheridan
On Tue, 2008-12-02 at 21:13 +, Nathan Rixham wrote: Nathan Rixham wrote: Brian Dunning wrote: IIS, Windows PHP 5.2.6, and unfortunately the downloads are https. On Dec 2, 2008, at 12:32 PM, Nathan Rixham wrote: what's the server running? iis/apache, win/linux version of php (as

Re: [PHP] Re: Slow file download

2008-12-02 Thread Nathan Rixham
Ashley Sheridan wrote: On Tue, 2008-12-02 at 21:13 +, Nathan Rixham wrote: Nathan Rixham wrote: Brian Dunning wrote: IIS, Windows PHP 5.2.6, and unfortunately the downloads are https. On Dec 2, 2008, at 12:32 PM, Nathan Rixham wrote: what's the server running? iis/apache, win/linux

Re: [PHP] Multiple MySQL INSERT

2008-12-02 Thread Chris
ddg2sailor wrote: chris smith-9 wrote: ddg2sailor wrote: $row = mysql_fetch_array($res); $res = mysql_query(SELECT passhash, editsecret, status FROM users WHERE id = $id); $row = mysql_fetch_array($res); I hope this is a copy/paste error or are you running the same thing twice? I diddnt

[PHP] stream_socket_accept() on an SSL socket

2008-12-02 Thread Darren
I'm trying to connect to an SSL server, but I keep on getting these errors: - PHP Warning: stream_socket_accept(): SSL operation failed with code 1. OpenSSL Error messages: error:140760FC:SSL routines:SSL23_GET_CLIENT_HELLO:unknown protocol in C:\scripts\bouncer.php on line 273 PHP

Re: [PHP] stream_socket_accept() on an SSL socket

2008-12-02 Thread Ashley Sheridan
On Tue, 2008-12-02 at 23:48 +, Darren wrote: I'm trying to connect to an SSL server, but I keep on getting these errors: - PHP Warning: stream_socket_accept(): SSL operation failed with code 1. OpenSSL Error messages: error:140760FC:SSL routines:SSL23_GET_CLIENT_HELLO:unknown

Re: [PHP] stream_socket_accept() on an SSL socket

2008-12-02 Thread Tim | iHostNZ
When you talk to an SSL server directly with sockets, I believe you need to implement the SSL protocol yourself, which would probably be overkill. There must be a PHP library which does or a native function. You should probably look at this page: http://nz.php.net/manual/en/wrappers.http.php and

Re: [PHP] stream_socket_accept() on an SSL socket

2008-12-02 Thread German Geek
When you talk to an SSL server directly with sockets, I believe you need to implement the SSL protocol yourself, which would probably be overkill. There must be a PHP library which does or a native function. You should probably look at this page: http://nz.php.net/manual/en/wrappers.http.php and

[PHP] Re: stream_socket_accept() on an SSL socket

2008-12-02 Thread Nathan Rixham
Darren wrote: I'm trying to connect to an SSL server, but I keep on getting these errors: - PHP Warning: stream_socket_accept(): SSL operation failed with code 1. OpenSSL Error messages: error:140760FC:SSL routines:SSL23_GET_CLIENT_HELLO:unknown protocol in C:\scripts\bouncer.php on

[PHP] Re: stream_socket_accept() on an SSL socket

2008-12-02 Thread Nathan Rixham
Darren wrote: I'm trying to connect to an SSL server, but I keep on getting these errors: - PHP Warning: stream_socket_accept(): SSL operation failed with code 1. OpenSSL Error messages: error:140760FC:SSL routines:SSL23_GET_CLIENT_HELLO:unknown protocol in C:\scripts\bouncer.php on

[PHP] Re: stream_socket_accept() on an SSL socket

2008-12-02 Thread Nathan Rixham
Nathan Rixham wrote: Darren wrote: I'm trying to connect to an SSL server, but I keep on getting these errors: - PHP Warning: stream_socket_accept(): SSL operation failed with code 1. OpenSSL Error messages: error:140760FC:SSL routines:SSL23_GET_CLIENT_HELLO:unknown protocol in

[PHP] Accessing the 'media' attribute in php

2008-12-02 Thread Clancy
Is it possible to access the 'media' attribute from php, so (for example) you can tailor a page for printing? -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php

Re: [PHP] Accessing the 'media' attribute in php

2008-12-02 Thread German Geek
PHP is a server side language... On Wed, Dec 3, 2008 at 2:16 PM, Clancy [EMAIL PROTECTED] wrote: Is it possible to access the 'media' attribute from php, so (for example) you can tailor a page for printing? -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit:

[PHP] Objects and Arrays Conversion

2008-12-02 Thread VamVan
Hello All, I was stuck with this issue. So just felt the need to reach out to other strugglers. May be people might enjoy this: Here is the code for object to array and array to object conversion: function object_2_array($data) { if(is_array($data) || is_object($data)) { $result

Re: [PHP] stream_socket_accept() on an SSL socket

2008-12-02 Thread ceo
First thing I would check is ?php phpinfo();? and make sure you have OpenSSL compiled in. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php

Re: [PHP] Accessing the 'media' attribute in php

2008-12-02 Thread ceo
I think you just want to have a CSS sheet for print media and be done with it. You could, in theory, add some kind of listener with JS, that would detect the 'media' attribute and then Ajax back to the server to do something, but that's an awful Rube Goldberg compared to just one more tag

Re: [PHP] Accessing the 'media' attribute in php

2008-12-02 Thread Clancy
Oh? Unfortunately I have had great difficulty trying to find out how things really work, as all the books I have seen are recipe books, which tell you how to achieve particular results, but not what is going on behind the scenes. I had assumed that when you hit the 'print' button the browser

Re: [PHP] Accessing the 'media' attribute in php

2008-12-02 Thread German Geek
You can do things on the client side with Javascript ;) Sorry, what was the result you are after? On Wed, Dec 3, 2008 at 3:22 PM, Clancy [EMAIL PROTECTED] wrote: Oh? Unfortunately I have had great difficulty trying to find out how things really work, as all the books I have seen are recipe

Re: [PHP] How to type arguments

2008-12-02 Thread Nathan Nobbe
On Tue, Dec 2, 2008 at 1:49 PM, Nathan Rixham [EMAIL PROTECTED] wrote: Richard Heyes wrote: I'm a french student, sorry for my mail : I want to know how can I type my functions' arguments ? It is heavy to do : function post($id) { $id=(int)$id; //... PHP is loosely typed so strictly

Re: [PHP] Objects and Arrays Conversion

2008-12-02 Thread Micah Gersten
VamVan wrote: Hello All, I was stuck with this issue. So just felt the need to reach out to other strugglers. May be people might enjoy this: Here is the code for object to array and array to object conversion: function object_2_array($data) { if(is_array($data) || is_object($data))

Re: [PHP] Multiple MySQL INSERT

2008-12-02 Thread ddg2sailor
chris smith-9 wrote: ddg2sailor wrote: It's still wrong regardless. I dont run the system , However the code I didnt post checks to make sure the user name or email isnt already in use or in fact was in use but removed. Diddnt have to bother with that part , it works fine. User A

[PHP] Re: stream_socket_accept() on an SSL socket

2008-12-02 Thread Darren
Darren wrote: I'm trying to connect to an SSL server, but I keep on getting these errors: - PHP Warning: stream_socket_accept(): SSL operation failed with code 1. OpenSSL Error messages: error:140760FC:SSL routines:SSL23_GET_CLIENT_HELLO:unknown protocol in C:\scripts\bouncer.php on

RE: [PHP] How to type arguments

2008-12-02 Thread Gautier Di Folco
Date: Tue, 2 Dec 2008 19:39:53 -0700 From: [EMAIL PROTECTED] To: [EMAIL PROTECTED] CC: [EMAIL PROTECTED]; [EMAIL PROTECTED]; php-general@lists.php.net Subject: Re: [PHP] How to type arguments On Tue, Dec 2, 2008 at 1:49 PM, Nathan Rixham [EMAIL PROTECTED] wrote: Richard Heyes wrote:

[PHP] SELECT into array of arrays

2008-12-02 Thread Andrej Kastrin
Dear all, I have a MySQL table 'test' which includes two columns: 'study' and 'symbol': study symbol a2008 A a2008 B a2008 C a2008 D b2005 A b2005 B b2005 E Using POST variable I passed 'study' values into $myArray: // $myArray is variable length; used only two values in example $myArray =

Re: [PHP] Accessing the 'media' attribute in php

2008-12-02 Thread Maciek Sokolewicz
Clancy wrote: Oh? Unfortunately I have had great difficulty trying to find out how things really work, as all the books I have seen are recipe books, which tell you how to achieve particular results, but not what is going on behind the scenes. I had assumed that when you hit the 'print'

Re: [PHP] Accessing the 'media' attribute in php

2008-12-02 Thread Clancy
On Wed, 3 Dec 2008 15:28:17 +1300, [EMAIL PROTECTED] (German Geek) wrote: You can do things on the client side with Javascript ;) Sorry, what was the result you are after? I have enough trouble getting my rather ancient brain around PHP, and was hoping that I could avoid getting involved with