Re: [PHP] counting records in db

2006-10-29 Thread Richard Lynch
On Fri, October 27, 2006 4:53 pm, Børge Holen wrote: > On Friday 27 October 2006 19:34, Richard Lynch wrote: >> And the header("Location: ...") requires a full URL. > > No it doesn't. but he's missing an ' at first glance Yes, it does: http://www.w3.org/Protocols/rfc2616/rfc2616-sec14.html#sec14.3

Re: [PHP] Decide witch table within a union

2006-10-29 Thread Ed Lazor
Sorry, Ed, I had intended my reply to be friendly as well. I'm allergic to smiley-face icons, but I should have tried harder to convey my tone. Dang this poker-faced email! No worries. It's all good :) -Ed -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://

Re: [PHP] counting records in db

2006-10-29 Thread Richard Lynch
On Fri, October 27, 2006 12:14 pm, [EMAIL PROTECTED] wrote: >> And the header("Location: ...") requires a full URL. > Why? Because the docs say so? Because some user agents will not do what you want them to if you don't? -- Some people have a "gift" link here. Know what I want? I want you to bu

Re: [PHP] Non-blocking sockets

2006-10-29 Thread Richard Lynch
On Fri, October 27, 2006 3:23 pm, Eric wrote: > When I create a socket/stream that connects to a news sever and try to > recv data from the socket when there is nothing there (Like if the > server sends one line and I call recv twice) the socket freezes. I > assume this is because using socket_crea

Re: [PHP] array, classes and values

2006-10-29 Thread Chris
martin wrote: hello, New to oop i'm really strugling to find a way to read a specified MYSQL database and tabel in order to determine the number of records, the number of fields in each record and convert the data into their labels and values. I suggest you search for "php mysql tutorial" in

Re: [PHP] How do I get ini_set('output_handler', '') to work?!

2006-10-29 Thread Richard Lynch
On Fri, October 27, 2006 3:46 pm, Daevid Vincent wrote: > What am I doing wrong... > > In my php.ini I have this for my web pages (and I want it): > > output_handler = ob_gzhandler > > But this causes my command line script to not show output until the > very > end. > > I thought I could disable

Re: [PHP] Decide witch table within a union

2006-10-29 Thread Paul Novitski
At 10/29/2006 08:04 PM, Ed Lazor wrote: That seems unreasonably harsh. I can see what you mean, but don't take it that way. I was trying to help. Sorry, Ed, I had intended my reply to be friendly as well. I'm allergic to smiley-face icons, but I should have tried harder to convey my tone

Re: [PHP] Is there such a thing?

2006-10-29 Thread Richard Lynch
On Fri, October 27, 2006 5:46 pm, Integz wrote: > http://www.evilbitz.com/2006/10/27/local-php-standalone-binaries-2/ I responded in that forum. Short Version: No. Check out: http://gtk.php.net/ -- Some people have a "gift" link here. Know what I want? I want you to buy a CD from some starvin

Re: [PHP] Uploading files.

2006-10-29 Thread Richard Lynch
On Sat, October 28, 2006 11:47 am, João Cândido de Souza Neto wrote: > I´m in a big doubt about uploading files ins a safe way. > > I wont give permission for the web server user to write in some folder > of my > system and then use move_uploaded_file function in order to keep it > secure. The upl

Re: [PHP] Re: A general UL script

2006-10-29 Thread Richard Lynch
On Sat, October 28, 2006 4:06 pm, Børge Holen wrote: > I'm trying to validate wether or not to run the image check script. > however empty the file field(s) are This script is started... how do I > tell it > there is nothing here, go do other stuff. > for both multiupload forms and single upload fo

RE: [PHP] Query question

2006-10-29 Thread Richard Lynch
On Sun, October 29, 2006 2:06 am, Beauford wrote: > This is how I get the data and I have no control over the actual > layout of > the database. So I have to work with what I have. When you say it's "how you get the data" are they handing you a MySQL database that is this badly-constructed? Or ar

Re: [PHP] strange problem with count()

2006-10-29 Thread Richard Lynch
On Sun, October 29, 2006 6:27 am, Gunnar Beushausen wrote: > I've a strange problem with count. I wrote a routine to jump to the > last > position of an array. You mean kind of like this one? http://php.net/end :-) I also suspect you are not doing count() on the right thing... -- Some people ha

Re: [PHP] Decide witch table within a union

2006-10-29 Thread Richard Lynch
On Sun, October 29, 2006 3:34 pm, Børge Holen wrote: > Hi. > I got this working (almost) > How do I decide (inside?) the whileloop the table_nr, 1 to 4 witch the > link is > echo'ed from. > > I could add another field in each table telling witch table it is. > Easy > solution, but feels like pollut

Re: [PHP] Decide witch table within a union

2006-10-29 Thread Ed Lazor
That seems unreasonably harsh. I can see what you mean, but don't take it that way. I was trying to help. What in your view is wrong with a union query that preserves an indicator of which component table a particular record comes from? Read earlier in the thread. He's talking about

Re: [PHP] Re: Is there such a thing?

2006-10-29 Thread Chris
Tom Atkinson wrote: http://gtk.php.net/ Integz wrote: http://www.evilbitz.com/2006/10/27/local-php-standalone-binaries-2/ Another interesting one is http://winbinder.org/ but it's windows only. -- Postgresql & php tutorials http://www.designmagick.com/ -- PHP General Mailing List (http:/

Re: [PHP] Decide witch table within a union

2006-10-29 Thread Paul Novitski
On Oct 29, 2006, at 2:00 PM, Børge Holen wrote: Would you suggest to use a extra field to hold the table name as default? At 10/29/2006 04:16 PM, Ed Lazor wrote: Definitely not. Review your design. If you need to know which table data comes from, then perform table specific queries. If y

[PHP] array, classes and values

2006-10-29 Thread martin
hello, New to oop i'm really strugling to find a way to read a specified MYSQL database and tabel in order to determine the number of records, the number of fields in each record and convert the data into their labels and values. Please give me some hints or code... Thanks, Martin -- PHP G

Re: [PHP] socket_recv

2006-10-29 Thread Ed Lazor
Depends on the volume and type of data that you're working with. It also depends on the type of connection between the server and client. Slower connections, unreliable connections, or general data, use smaller packets. Reliable connection or higher volumes of data, use larger packets.

Re: [PHP] IMAP functions for NNTP

2006-10-29 Thread Chris
Eric wrote: How would I go about listing all newsgroups via the IMAP functions? Maybe http://www.php.net/manual/en/function.imap-list.php ? It mentions "mailboxes" but the imap functions work for news & imap accounts. -- Postgresql & php tutorials http://www.designmagick.com/ -- PHP General

[PHP] socket_recv

2006-10-29 Thread Eric
Is there a reccomended size of data to pull in with socket_recv (Such as 1024) or can I pull in 981132487 and it wont make a difference? Thanks in advance. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php

Re: [PHP] Decide witch table within a union

2006-10-29 Thread Ed Lazor
Definitely not. Review your design. If you need to know which table data comes from, then perform table specific queries. If you need to combine data from more than one table, code your application to respond accordingly. You may also need to review your database schema design in order

Re: [PHP] Decide witch table within a union

2006-10-29 Thread Chris
Børge Holen wrote: Ok. Would you suggest to use a extra field to hold the table name as default? Why do you need to know which table it's in? What are you going to use it for in the next step? I see you're passing it in: echo "page"; but what are you going to do with it? I think if you ex

Re: [PHP] str_replace on words with an array

2006-10-29 Thread Ed Lazor
checkout the function mysql_real_escape_string() On Oct 29, 2006, at 3:13 PM, Dotan Cohen wrote: On 30/10/06, Paul Novitski <[EMAIL PROTECTED]> wrote: Hi Dotan, To get help with your problem, share more of your PHP code with the list so we can look at what you're doing. Also, give us a link

Re: [PHP] str_replace on words with an array

2006-10-29 Thread Dotan Cohen
On 30/10/06, Paul Novitski <[EMAIL PROTECTED]> wrote: Hi Dotan, To get help with your problem, share more of your PHP code with the list so we can look at what you're doing. Also, give us a link to the PHP script on your server so we can see the output. Regards, Paul Nothing else is relevan

Re: [PHP] str_replace on words with an array

2006-10-29 Thread Stut
Dotan Cohen wrote: > Thanks all for the heads up with the str_replace not working with > regexes. Duh! I've switched to preg_replace, but still no luck. (nor > skill, on my part) > > I'm trying to use array_walk to go through the array and deliminate > each item with /b so that the preg_replace fu

Re: [PHP] str_replace on words with an array

2006-10-29 Thread Dotan Cohen
Thanks all for the heads up with the str_replace not working with regexes. Duh! I've switched to preg_replace, but still no luck. (nor skill, on my part) I'm trying to use array_walk to go through the array and deliminate each item with /b so that the preg_replace function will know to only opera

Re: [PHP] str_replace on words with an array

2006-10-29 Thread Paul Novitski
Paul Novitski wrote: If you go this route, perhaps you could enclose each member of your original array in \b word boundary sequences using an array_walk routine so that you don't have to muddy your original array declaration statement. At 10/29/2006 01:54 PM, rich gray wrote: IIRC str_repl

Re: [PHP] str_replace on words with an array

2006-10-29 Thread Dotan Cohen
On 29/10/06, Børge Holen <[EMAIL PROTECTED]> wrote: Yes you need to put some \ in front of some of those characters On Sunday 29 October 2006 21:05, Dotan Cohen wrote: > I need to remove the noise words from a search string. I can't seem to > get str_replace to go through the array and remove th

Re: [PHP] str_replace on words with an array

2006-10-29 Thread Stut
Dotan Cohen wrote: > $searchQuery=str_replace( "^".$noiseArray."$", " ", $searchQuery); Ok, this is what the compiler will see... $searchQuery=str_replace("^Array$", " ", $searchQuery); Yes, that's a literal Array in the string. You cannot, and you should remember this, you cannot concatenate st

Re: [PHP] Decide witch table within a union

2006-10-29 Thread Børge Holen
Ok. Would you suggest to use a extra field to hold the table name as default? On Sunday 29 October 2006 22:59, Ed Lazor wrote: > PHP can't tell what table the data came from. > > On Oct 29, 2006, at 1:34 PM, Børge Holen wrote: > > Hi. > > I got this working (almost) > > How do I decide (inside?)

Re: [PHP] Decide witch table within a union

2006-10-29 Thread Ed Lazor
PHP can't tell what table the data came from. On Oct 29, 2006, at 1:34 PM, Børge Holen wrote: Hi. I got this working (almost) How do I decide (inside?) the whileloop the table_nr, 1 to 4 witch the link is echo'ed from. I could add another field in each table telling witch table it is. Ea

Re: [PHP] str_replace on words with an array

2006-10-29 Thread rich gray
Paul Novitski wrote: If you go this route, perhaps you could enclose each member of your original array in \b word boundary sequences using an array_walk routine so that you don't have to muddy your original array declaration statement. IIRC str_replace() does not interpret or understand re

Re: [PHP] str_replace on words with an array

2006-10-29 Thread Myron Turner
I never use this function, since I always use regular expressions, but according to the manual: If you don't need fancy replacing rules (like regular expressions), you should always use this function instead of ereg_replace() or preg_replace(). So, I assume your problem

Re: [PHP] str_replace on words with an array

2006-10-29 Thread Paul Novitski
At 10/29/2006 01:07 PM, Dotan Cohen wrote: The purpose of the ^ and the $ is to define the beginning and the end of a word: http://il2.php.net/regex No, actually, ^ and $ define the beginnning & end of the entire expression being searched, not the boundaries of a single word. Therefore sea

[PHP] Decide witch table within a union

2006-10-29 Thread Børge Holen
Hi. I got this working (almost) How do I decide (inside?) the whileloop the table_nr, 1 to 4 witch the link is echo'ed from. I could add another field in each table telling witch table it is. Easy solution, but feels like polluting the db. Also I could do another loop to check another of the pr

Re: [PHP] str_replace on words with an array

2006-10-29 Thread Dotan Cohen
On 29/10/06, Alan Milnes <[EMAIL PROTECTED]> wrote: Dotan Cohen wrote: > $searchQuery=str_replace( "^".$noiseArray."$", " ", $searchQuery); Can you explain what you are trying to do with the ^ and $? What is a typical value of the original $searchQuery? Alan The purpose of the ^ and the $ is

Re: [PHP] forms usage in web pages

2006-10-29 Thread Børge Holen
yes, but then again, I've already mentioned this, and have seen some posts now an then mention the subject... :) On Sunday 29 October 2006 21:26, Ed Lazor wrote: > Is anyone else getting multiple copies of posts? > > On Oct 29, 2006, at 9:52 AM, Larry Garfield wrote: > > There's nothing wrong wi

Re: [PHP] str_replace on words with an array

2006-10-29 Thread Børge Holen
Yes you need to put some \ in front of some of those characters On Sunday 29 October 2006 21:05, Dotan Cohen wrote: > I need to remove the noise words from a search string. I can't seem to > get str_replace to go through the array and remove the words, and I'd > rather avoid a redundant foreach it

Re: [PHP] forms usage in web pages

2006-10-29 Thread Ed Lazor
Is anyone else getting multiple copies of posts? On Oct 29, 2006, at 9:52 AM, Larry Garfield wrote: There's nothing wrong with multiple forms on a single page, as long as all id attributes in all elements are unique on the entire page, not just within the form. Just make sure that each for

[PHP] str_replace on words with an array

2006-10-29 Thread Dotan Cohen
I need to remove the noise words from a search string. I can't seem to get str_replace to go through the array and remove the words, and I'd rather avoid a redundant foreach it I can. According to TFM str_replace should automatically go through the whole array, no? Does anybody see anything wrong

Re: [PHP] Memcached Question

2006-10-29 Thread Sancar Saran
On Sunday 29 October 2006 19:21, Michal Manko wrote: Thanks, And I found APC had shared memory access like this if(!$_LIVE['_CONF'] = apc_fetch('_LIVE_CONF')) { require('inc/config.inc.php'); apc_store('_LIVE_CONF',$_LIVE['_CONF']); } Regards Sancar > Hi, > Best reference will be http://p

[PHP] IMAP functions for NNTP

2006-10-29 Thread Eric
How would I go about listing all newsgroups via the IMAP functions? -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php

Re: [PHP] forms usage in web pages

2006-10-29 Thread Larry Garfield
There's nothing wrong with multiple forms on a single page, as long as all id attributes in all elements are unique on the entire page, not just within the form. Just make sure that each form is self-contained with its own submit button and such. Only the form whose submit button is clicked wi

Re: [PHP] heredoc usage [WAS:

2006-10-29 Thread Larry Garfield
On Saturday 28 October 2006 18:15, Robert Cummings wrote: > >As far as I can tell, single and double quotes > > are interchangeable (but unmixable) in both HTML > > and XHTML. When did single quotes go bad? > > Hmmm, I've been under the impression for quite some time that single > quotes are s

Re: [PHP] strange problem with count()

2006-10-29 Thread Ed Lazor
Side note, it sounds like $this->result is an object holding an array, not the array itself and print_r is automatically traversing the object. On Oct 29, 2006, at 4:27 AM, Gunnar Beushausen wrote: Hi! I've a strange problem with count. I wrote a routine to jump to the last position of

[PHP] strange problem with count()

2006-10-29 Thread Gunnar Beushausen
Hi! I've a strange problem with count. I wrote a routine to jump to the last position of an array. The code ist this: if(!$this->done) { array_push($this->result, $this->stmt->fetchall_assoc()); } $this->done = true; $this->currIndex = $this->rowIndex = count($this->result)-1; return $

Re: [PHP] Memcached Question

2006-10-29 Thread Michal Manko
Hi, Best reference will be http://php.net/memcache i think. Memcache is really effective tool, but it have one fault. Data keeping in this way are not stable. Generally memcache is useful as a some kind of cache when you can have second data source, or when data, you want to save, have short ttl

Re: [PHP] Query question

2006-10-29 Thread Ed Lazor
You'd still benefit from converting your data into an actual date format in order to take full advantage of available features. hehe You guys are going to start thinking of me as a performance freak, but I think MySQL's date functions might provide better performance than string manipulati

RE: [PHP] Query question

2006-10-29 Thread Beauford
I don't see this as a particular problem as the data will always be the same. Now under other circumstances in another database, I can see what you are saying. -Original Message- From: Satyam [mailto:[EMAIL PROTECTED] Sent: October 29, 2006 4:30 AM To: Beauford; 'PHP' Subject: Re: [PHP]

Re: [PHP] A general UL script

2006-10-29 Thread Børge Holen
No, I did not post my orginal message. I posted my continuos work with solutions I found myself. However, I recieve two of every message posted to this list. CC or not. On Sunday 29 October 2006 03:18, Ed Lazor wrote: > You posted this earlier and people, myself included, responded. I > don't k

Re: [PHP] Query question

2006-10-29 Thread Satyam
I said that you have a problem,not that you caused it, and my observation might (hopefully) help newbies in the list. Satyam - Original Message - From: "Beauford" <[EMAIL PROTECTED]> To: "'PHP'" Sent: Sunday, October 29, 2006 9:06 AM Subject: RE: [PHP] Query question This is how

Re: [PHP] forms usage in web pages

2006-10-29 Thread Robert Cummings
On Sun, 2006-10-29 at 13:15 +0530, Karthi S wrote: > hi, > > i am newbie to web programming. i have a basic doubt in using forms. > > Is it advisable to use multiple forms performing various functions in a > single web page. > what are the pros and cons of using that. > > Please forgive me if th

RE: [PHP] Query question

2006-10-29 Thread Beauford
This is how I get the data and I have no control over the actual layout of the database. So I have to work with what I have. Robert: LOL, I don't know either. The format is - 01/01/2006. When I first did it I used 7, which should be right, but I ended up getting /2002 /2003, etc. So I went to 8

[PHP] forms usage in web pages

2006-10-29 Thread Karthi S
hi, i am newbie to web programming. i have a basic doubt in using forms. Is it advisable to use multiple forms performing various functions in a single web page. what are the pros and cons of using that. Please forgive me if this is not the right mailing list to post this question. But help me

Re: [PHP] Query question

2006-10-29 Thread Satyam
If that works then you have a problem: you are storing dates as a plain string ( varchar or whatever) instead of a native date/time datatype, which precludes the use of a large number of native SQL date/time functions, such as year() which should suit you nicely in this case. Eventually, you w

RE: [PHP] Query question

2006-10-29 Thread Robert Cummings
On Sun, 2006-10-29 at 01:05 -0500, Beauford wrote: > This is what I finally figured out, which works just perfectly. > > select count(date) as count, substring(date,8) as year from stats group by > year; > > Thanks to all for the input. So what you're saying is that you're not using a date field

Re: [PHP] Upload not finding directory to write to.

2006-10-29 Thread Jochem Maas
Robert Cummings wrote: > On Sat, 2006-10-28 at 14:49 +0900, Dave M G wrote: >> PHP List, >> >> I had a file upload script which was working fine. Then, because of >> other needs, I changed my local Apache settings so that my local web >> site directory structure behaved the same as they do on my