php-general Digest 1 May 2008 07:55:49 -0000 Issue 5434

2008-05-01 Thread php-general-digest-help
php-general Digest 1 May 2008 07:55:49 - Issue 5434 Topics (messages 273738 through 273758): Re: Fun with SOAP. 273738 by: Larry Brown 273739 by: Nathan Nobbe Re: php 5 and mysql failure 273740 by: Shawn McKenzie 273741 by: Dan Joseph check if any element

Re: [PHP] Best practices for using MySQL index

2008-05-01 Thread Shelley
On Wed, Apr 30, 2008 at 7:03 PM, Aschwin Wesselius [EMAIL PROTECTED] wrote: Shelley wrote: Don't index just all integer fields. Keep track of the cardinality of a column. If you expect a field to have 100.000 records, but with only 500 distinct values it has no use to put an index on that

Re: [PHP] Best practices for using MySQL index

2008-05-01 Thread Shelley
On Thu, May 1, 2008 at 9:54 AM, Larry Garfield [EMAIL PROTECTED] wrote: On Wednesday 30 April 2008, Chris wrote: Index on most integer fields only. Text fields can be indexed, but is not important when you design your DB well. Don't index just all integer fields. Keep track of the

Re: [PHP] Best practices for using MySQL index

2008-05-01 Thread Chris
Point above about spread still applies, but if you can join index to index, the join goes a lot faster. (A primary key in MySQL is always indexed.) How much is the *a lot*? Thanks. :) If it's a unique (including primary) key then orders of magnitude for millions of rows. If it's a

[PHP] equivalent to perl shift function

2008-05-01 Thread Richard Luckhurst
Hi All I am in the process of porting a perl script and I am trying to fin out if there is a php equivalent to the perl shift function? I have been looking at the php manual and google searching so far with no luck. Regards, Richard Luckhurst -- PHP General Mailing

Re: [PHP] equivalent to perl shift function

2008-05-01 Thread Chris
Richard Luckhurst wrote: Hi All I am in the process of porting a perl script and I am trying to fin out if there is a php equivalent to the perl shift function? I have been looking at the php manual and google searching so far with no luck.

Re[2]: [PHP] equivalent to perl shift function

2008-05-01 Thread Richard Luckhurst
Hi Chris, In perl ther is the concept of @_ which is the list of incoming parameter to a subroutine. It is possible to have something like my $sock = shift; As I understand this the first parameter of the @_ list would be shifted. I see for array_shift there must be an argument, the array

Re: Re[2]: [PHP] equivalent to perl shift function

2008-05-01 Thread Robin Vickery
2008/5/1 Richard Luckhurst [EMAIL PROTECTED]: Hi Chris, In perl ther is the concept of @_ which is the list of incoming parameter to a subroutine. It is possible to have something like my $sock = shift; As I understand this the first parameter of the @_ list would be shifted. I

Re: [PHP] check if any element of an array is not empty

2008-05-01 Thread Robin Vickery
2008/4/30 Nathan Nobbe [EMAIL PROTECTED]: On Wed, Apr 30, 2008 at 2:58 PM, Richard Heyes [EMAIL PROTECTED] wrote: but I was thinking if there is the function does that. array_filter(). Note this: If no callback is supplied, all entries of input equal to FALSE (see converting

Re: [PHP] check if any element of an array is not empty

2008-05-01 Thread Richard Heyes
i dont really see how that gets him the answer without at least checking the number of elements in the array after filtering it w/ array_filter; which if he wanted to reuse in several places would make sense to write a simple function for anyway.. Yes, on both counts. -- Richard Heyes

[PHP] Re: Question regarding fopen

2008-05-01 Thread Joep Roebroek
Does anyone have an idea? Is this a bug in PHP? Because when I add or remove one static letter in the filename, it does work. And if I don't the file is created, but the $imgstr (random 8 characters) is replaced by a totally different value (also random 8 characters).. I have no idea where this

Re: [PHP] Re: Question regarding fopen

2008-05-01 Thread James Dempster
?php $foldersystem = getcwd().'/test1'; $id = '54961'; $imgstr = 'tdtdtdtd'; //uniqid(); $i = 2; $imagenamesmall = $foldersystem . '/' . $id . $imgstr . '-s' . $i . '.jpg'; echo $imagenamesmall; // For debugging purposses -- returns exactly what I want. //attempt to create folder

Re: [PHP] web based chat app

2008-05-01 Thread Børge Holen
On Wednesday 30 April 2008 10:45:30 paragasu wrote: On Wed, Apr 30, 2008 at 4:28 PM, paragasu [EMAIL PROTECTED] wrote: You want light outta it?use the jabber2 server as a backend. It'll be done serving while you try to access the database. No need to do a square wheel, when a

Re: [PHP] Re: Question regarding fopen

2008-05-01 Thread Joep Roebroek
Strangely enough.. It does.. But I have also tried adding a letter (which gives me the good result) and then renaming it... But then the value is wrong again :S I've never had a problem like this.. Very strange.. 2008/5/1 James Dempster [EMAIL PROTECTED]: ?php $foldersystem =

Re: [PHP] Re: Question regarding fopen

2008-05-01 Thread James Dempster
Do you have a piece of example code that will reproduce the problem? -- /James On Thu, May 1, 2008 at 12:26 PM, Joep Roebroek [EMAIL PROTECTED] wrote: Strangely enough.. It does.. But I have also tried adding a letter (which gives me the good result) and then renaming it... But then the

Re: [PHP] Re: Question regarding fopen

2008-05-01 Thread Joep Roebroek
This problem is getting stranger by the minute. I will explain in a little more detail what the script is actually for.. It is an advert site and per advert, you can add 5 photo's.. Now you set the $i = 2; When I set the $i (which indictates the index of the photo, so $i = 5; is the last photo)

[PHP] mysql query and maximum characters in sql statement

2008-05-01 Thread Sanjeev N
Hi, I have written a program which imports the tab delimited file and insert all the line from file to the mysql line by line. I am succeding in the above case. but problem with the above method is its taking to too much time while inserting into the database. The file's size will be more than

Re: [PHP] Re: Question regarding fopen

2008-05-01 Thread Joep Roebroek
Small correction $i = 4, means the last photo not 5.. Not so important but still.:P 2008/5/1 Joep Roebroek [EMAIL PROTECTED]: This problem is getting stranger by the minute. I will explain in a little more detail what the script is actually for.. It is an advert site and per advert, you can

Re: [PHP] Fun with SOAP.

2008-05-01 Thread Eric Butera
On Wed, Apr 30, 2008 at 3:53 PM, Larry Brown [EMAIL PROTECTED] wrote: I'm not sure how it looks etc with with soapui but I noticed you mentioning you don't want to mess with nusoap. I've used nusoap for both client and server uses for years and I'm really impressed with how easily it

[PHP] extending Xpath

2008-05-01 Thread Andrew Mason
Hi, I was wondering if it was possible to extend the DOMXpath object in a similar fashion to the DomDocument. I was hoping to write a wrapper to provide an interface similar to prepared statements in the db libraries for the xpath processor. $xpath = new myxpath(); $stmt =

Re: [PHP] web based chat app

2008-05-01 Thread paragasu
you build one. Thats the point of it wasn't it eh? A friend and I made a chat with jabber throught second life (the game) and a php webpage. interesting. i really wan't to try out your chat implementation. may i? i don't know how to integrate php with jabber since i don't have much

Re: [PHP] Xampp question, pretty much 0T

2008-05-01 Thread Ryan S
/* Top posting from my cell... 1. Format hard drive 2. Install redhat fc8 or Ubuntu 8.04 3. Load the new MySQL installation with your backup file If you really have to stay with windoze, remove and re-install apache. Look at the system log files as they SHOULD tell you what was causing the

Re: [PHP] Xampp question, pretty much 0T

2008-05-01 Thread Jason Pruim
On May 1, 2008, at 8:56 AM, Ryan S wrote: /* Top posting from my cell... 1. Format hard drive 2. Install redhat fc8 or Ubuntu 8.04 3. Load the new MySQL installation with your backup file If you really have to stay with windoze, remove and re-install apache. Look at the system log files

[PHP] Categories like wordpress

2008-05-01 Thread Ryan S
Hey! Heres what i have to do, upload pics and each pic can be a part of x number of categores for example: A picture of a rose can be for birthday, as well as anniversary, or miss you, or love etc exactly the same as how in wordpress an article can be in multiple categories like tech, current

Re: [PHP] Categories like wordpress

2008-05-01 Thread Dan Joseph
On Thu, May 1, 2008 at 9:23 AM, Ryan S [EMAIL PROTECTED] wrote: Hey! Heres what i have to do, upload pics and each pic can be a part of x number of categores for example: A picture of a rose can be for birthday, as well as anniversary, or miss you, or love etc exactly the same as how in

Re: [PHP] Xampp question, pretty much 0T

2008-05-01 Thread Ryan S
/* Top posting from my cell... 1. Format hard drive 2. Install redhat fc8 or Ubuntu 8.04 3. Load the new MySQL installation with your backup file If you really have to stay with windoze, remove and re-install apache. Look at the system log files as they SHOULD tell you what was

Re: [PHP] mysql query and maximum characters in sql statement

2008-05-01 Thread Wolf
Sanjeev N [EMAIL PROTECTED] wrote: Hi, I have written a program which imports the tab delimited file and insert all the line from file to the mysql line by line. I am succeding in the above case. but problem with the above method is its taking to too much time while inserting into the

Re: [PHP] Xampp question, pretty much 0T

2008-05-01 Thread Jason Pruim
On May 1, 2008, at 9:30 AM, Ryan S wrote: /* Top posting from my cell... 1. Format hard drive 2. Install redhat fc8 or Ubuntu 8.04 3. Load the new MySQL installation with your backup file If you really have to stay with windoze, remove and re-install apache. Look at the system log

Re: [PHP] Categories like wordpress

2008-05-01 Thread Richard Heyes
Is this how its done or am I barking up the wrong tree? You have multiple options: 1. Fully normalised, where you have three tables - one for your articles, one for your categories and a link table. 2. A SET MySQL datatype which will allow upto 32 predefined categories. 3. A simple CHAR

Re: [PHP] Categories like wordpress

2008-05-01 Thread Brady Mitchell
On May 1, 2008, at 743AM, Richard Heyes wrote: Is this how its done or am I barking up the wrong tree? You have multiple options: 1. Fully normalised, where you have three tables - one for your articles, one for your categories and a link table. This is the route that I would suggest,

Re: [PHP] extending Xpath

2008-05-01 Thread Jim Lucas
Andrew Mason wrote: Hi, I was wondering if it was possible to extend the DOMXpath object in a similar fashion to the DomDocument. I was hoping to write a wrapper to provide an interface similar to prepared statements in the db libraries for the xpath processor. $xpath = new myxpath(); $stmt

Re: [PHP] Categories like wordpress

2008-05-01 Thread Richard Heyes
it's the most flexible and fastest to query. Mmm, that's debateable. Not knowing the ins and outs of MySQL I'd hazard a guess that reading an extra 255 bytes from the table file might be faster in some circumstances than opening two extra table files. And I don't see why it's more

Re: [PHP] Xampp question, pretty much 0T

2008-05-01 Thread Ryan S
Cant afford a new comp or a new OS and as for your last statement: http://www.sophos.com.au/pressoffice/news/articles/2006/02/macosxleap.html _almost_ no virii for the Mac :) /* None that have effected my computers here at work, or at home. No anti- virus, no firewall's ;) Oh and I'll

Re: [PHP] Xampp question, pretty much 0T

2008-05-01 Thread Jason Pruim
On May 1, 2008, at 11:43 AM, Ryan S wrote: Cant afford a new comp or a new OS and as for your last statement: http://www.sophos.com.au/pressoffice/news/articles/2006/02/macosxleap.html _almost_ no virii for the Mac :) /* None that have effected my computers here at work, or at home. No

Re: [PHP] Categories like wordpress

2008-05-01 Thread Ryan S
Hey! Thanks for replying guys! clip 1. Fully normalised, where you have three tables - one for your articles, one for your categories and a link table. This is the route that I would suggest, it's the most flexible and fastest to query. /clip Anyone happen to have a little PHP code

Re: [PHP] mysql query and maximum characters in sql statement

2008-05-01 Thread Jim Lucas
Sanjeev N wrote: Hi, I have written a program which imports the tab delimited file and insert all the line from file to the mysql line by line. I am succeding in the above case. but problem with the above method is its taking to too much time while inserting into the database. The file's size

Re: [PHP] Categories like wordpress

2008-05-01 Thread Brady Mitchell
On May 1, 2008, at 843AM, Richard Heyes wrote: it's the most flexible and fastest to query. Mmm, that's debateable. Not knowing the ins and outs of MySQL I'd hazard a guess that reading an extra 255 bytes from the table file might be faster in some circumstances than opening two extra

Re: [PHP] mysql query and maximum characters in sql statement

2008-05-01 Thread Jim Lucas
Jim Lucas wrote: Sanjeev N wrote: Hi, I have written a program which imports the tab delimited file and insert all the line from file to the mysql line by line. I am succeding in the above case. but problem with the above method is its taking to too much time while inserting into the

Re: [PHP] Categories like wordpress

2008-05-01 Thread Ryan S
Hey, Am not really used to using the JOIN in SQL so am a bit confused as to what kind of data I need to enter into this table: image_category_mapping table: - image_id - category_id for all of this to work... mind explaining a bit? Thanks! Ryan

Re: [PHP] web based chat app

2008-05-01 Thread Nitsan Bin-Nun
umm sorry for interupting but RTFM / STFM? btw, if you dont need history you can write an webby irc client On 01/05/2008, paragasu [EMAIL PROTECTED] wrote: you build one. Thats the point of it wasn't it eh? A friend and I made a chat with jabber throught second life (the game) and a

Re: [PHP] mysql query and maximum characters in sql statement

2008-05-01 Thread Waynn Lue
Wouldn't using LOAD DATA INFILE be better than writing your own script? On 5/1/08, Jim Lucas [EMAIL PROTECTED] wrote: Jim Lucas wrote: Sanjeev N wrote: Hi, I have written a program which imports the tab delimited file and insert all the line from file to the mysql line by line. I

Re: [PHP] check if any element of an array is not empty

2008-05-01 Thread tedd
At 3:36 PM -0500 4/30/08, afan pasalic wrote: hi, as a result of one calculation I'm receiving an array where elements could be 0 or date (as string -mm-dd hh:ii:ss). I have to check if any of elements of the array is date or if all elements of the array is 0? If I try array_sum($result)

Re: [PHP] Categories like wordpress

2008-05-01 Thread Chris
Ryan S wrote: Hey, Am not really used to using the JOIN in SQL so am a bit confused as to what kind of data I need to enter into this table: image_category_mapping table: - image_id - category_id It comes down to database normalization