Re: [PHP] Re: [users@httpd] Favorite Linux Distribution

2005-02-08 Thread Gareth Williams
I would agree with the Mandrake recommendation. I first installed it a few years back, to help me get started in the Linux/Unix world, and had very little trouble with it. It's hardware recognition has always been very impressive. Since first installing Mandrake, I have often thought I should

Re: [PHP] [NEWBIE] Trying to combine array into one string

2005-02-15 Thread Gareth Williams
Use implode: http://nl2.php.net/manual/en/function.implode.php On 15 Feb 2005, at 16:37, Dave wrote: PHP General, The Situation: I'm retrieving some email addresses from a database. I want to be able assemble all the addresses into one string that I can use in the mail() command. At no

Re: [PHP] Improving a MySQL Search

2005-02-28 Thread Gareth Williams
Create some indexes. I spend most of my day messing around with a table of 200 records, and indexes increased the speed from 40 seconds to 55 minutes for a query, down to the longest being less than 5 seconds. On 28 Feb 2005, at 16:42, James Nunnerley wrote: I'm creating a serious of

Re: [PHP] Preventing data from being reposted?

2005-03-03 Thread Gareth Williams
Wouldn't using GET instead of POST help? Gareth Williams venditor.com Buy cool stuff online at a href=http://www.venditor.com;venditor.com/a On 3 Mar 2005, at 14:20, Jochem Maas wrote: rory walsh wrote: Thanks Eoghan, I have tried the following but it still reposts the data from the form

[PHP] Object References Problem

2003-10-30 Thread Gareth Williams
Hi there, I'm having trouble with passing objects as references. What I want to do is something like this: class object_1 { var $my_chld; var $my_array; function object_1() { $this-my_array = array('id' = 0, 'name'=''); $this-my_child =

Re: [PHP] Object References Problem

2003-10-31 Thread Gareth Williams
Boyan, Michael and Mike, Thanks for the help, I now understand what is going on, and you guys have saved me from pulling my hair out in frustration. I'm more used to doing OOP in Delphi and Perl, and the peculiarities of PHP are somewhat confusing. Once again, thanks for the help. On Friday,

Re: [PHP] using existing mysql connection in a php extension

2003-10-31 Thread Gareth Williams
Hi there, Try this: mysql_pconnect($_host, $_user, $_password) or die(Could not connect: . mysql_error());; This open a permanent mysql connection. The first time you run it, it opens the connection, and the second time, etc, it just uses the one already opened. On Friday, Oct 31,

Re: [PHP] Session for creating a unique shopping cart for each user

2003-10-31 Thread Gareth Williams
Have you already sent anything to the browser? Once the first echo has been performed, you can't send header information, as the header is sent with the first bit of text. On Friday, Oct 31, 2003, at 15:47 Europe/Amsterdam, Tore E. Mackay wrote: Hi, I am creating a shopping cart but

Re: [PHP] Session for creating a unique shopping cart for each user

2003-10-31 Thread Gareth Williams
. It works fine if I go passed the index.php file. Maybe it is because the index.php file has echoed information. Any idea Tore Gareth Williams [EMAIL PROTECTED] skrev i melding news:[EMAIL PROTECTED] Have you already sent anything to the browser? Once the first echo has been performed

Re: [PHP] Moving to php

2003-11-16 Thread Gareth Williams
hi there, I suppose that technically PHP is built to run on Linux, but does work on many other platforms. I do all of my development on OS X and have never had any problems, I've also had it running on Linux and FreeBSD without any trouble. I think there is no problem with Win2000, but I

Re: [PHP] Class rules

2004-02-17 Thread Gareth Williams
Hi there, Try include_once(), it's much safer Cheers, Gareth On 17 Feb 2004, at 23:02, Alex Hogan wrote: Hi All, What are the rules of thumb for classes and included files? Can I not include a file in a class function? If I put the include() outside the class structure everything works

Re: [PHP] Paginate any query

2004-02-17 Thread Gareth Williams
Hi, In your mysql query, use the LIMIT keyword at or near to the end of the query. LIMIT 1000 will limit to the first thousand records LIMIT 2000,1000 will retrieve 1000 records, offset by 2000 records. Cheers, Gareth On 17 Feb 2004, at 22:12, Shaun wrote: Hi, I use the following function

Re: [PHP] Finding orphan functions

2004-02-18 Thread Gareth Williams
Well if you are a unix/linux/os x user, drop to the command line, go to the directory with all the php files, and type in: grep function_name php or if your php files are scattered around a load of sub-directories, then go to a directory which sits above all your php files, and type in: grep

Re: [PHP] Finding orphan functions

2004-02-18 Thread Gareth Williams
No probs. On 18 Feb 2004, at 16:34, pete M wrote: Wicked - that's the best tip I've seen for a long time... TA Gareth Williams wrote: Well if you are a unix/linux/os x user, drop to the command line, go to the directory with all the php files, and type in: grep function_name php or if your php

Re: [PHP] PHP, Cache Control and Mac IE

2004-02-18 Thread Gareth Williams
Hello Roger, If you find a solution, I would also be interested to to see it. I have tried almost everything to get Mac IE to not use the cache. It just doesn't seem to accept anything. On 18 Feb 2004, at 18:58, Roger Spears wrote: Hello List, I am using the following in a PHP script:

Re: [PHP] Re: Image resize on upload

2004-02-26 Thread Gareth Williams
I'll second that one, I wrote a shell script in PHP to resize images, using ImageMagicks mogrify command, and it took ages. It's really much too slow for a web site. If you need a faster solution, I think you have to buy something. On 26 Feb 2004, at 09:15, Adam Bregenzer wrote: On Thu,

Re: [PHP] How to get the auto-incremented value?

2004-02-26 Thread Gareth Williams
The function mysql_insert_id() will return the correct value. On 26 Feb 2004, at 17:10, Brian Dunning wrote: When I write a record to a MySQL db with an auto-incremented key column, say it's called id, what's the easy to retrieve that value? Do I have to run a query? -- PHP General Mailing

Re: [PHP] Passing the value of a variable from PHP to JavaScript.

2004-02-27 Thread Gareth Williams
Try this: function tes(selCtrl){ document.write('pJavaScript/p'); window.location.replace('http://192.168.23.1/coba/coba.php? vtes='+selCtrl.value); } select onchange='tes(this)' name='vtes' or this: function tes(){ selCtrl = document.getElementById('vtes');

Re: [PHP] 2 OOP or Not 2 OOP

2004-02-28 Thread Gareth Williams
I had programmed for years in OO, and when I learned PHP, it only seemed natural to stay with it. I personally find the OO functionality in PHP to be not quite complete, but good enough for daily use. In fact, I don't write any sites in a non-oo manner. I love it. On 28 Feb 2004, at

Re: [PHP] OTP: Programming

2004-03-08 Thread Gareth Williams
The easiest language to learn for Windows is Visual Basic. You can get a simple gui app up and running in minutes. On 8 Mar 2004, at 14:40, Jay Blanchard wrote: [snip] I have been working with PHP for a few years now, and I feel very comfortable with it. I am considering branching out into

Re: [PHP] Problem with number_format

2004-05-25 Thread Gareth Williams
Hi there, Try using: round($number, 2); cheers, Gareth On 25 May 2004, at 16:00, [EMAIL PROTECTED] wrote: Hi, please suppose PHP 4.3.2 and $number=502,3550 number_format($number,2,'.',' ') returns 502.36. It seems ok, but if $number=253,0650 number_format($number,2,'.',' ') returns 253.06 instead

Re: [PHP] submission before

2004-10-13 Thread Gareth Williams
I think you'll find that this is more of a Javascript problem than a PHP one. On 13 Oct 2004, at 12:11, Bruno Santos wrote: hello all. I've a question that i might think is not much related with PHP, even the pages are PHP and everything is working with PHP. I've a FORM in my site to be

Re: [PHP] How to optimize select of random record in DB ?

2004-10-15 Thread Gareth Williams
What about in MySQL: SELECT personID from persons ORDER BY RAND(NOW()) LIMIT 1 If the table is large, then the following might be better: LOCK TABLES foo READ; SELECT FLOOR(RAND() * COUNT(*)) AS rand_row FROM foo; SELECT * FROM foo LIMIT $rand_row, 1; UNLOCK TABLES; There's a whole discussion on

Re: [PHP] Regular Expression for a UK Mobile

2004-10-15 Thread Gareth Williams
Do you even need a regex? What about if (strlen($_POST['mobile_number']) != 11 substr($_POST['mobile_number'],0,3) != 447) { $error=Invalid Number; } On 15 Oct 2004, at 13:38, Shaun wrote: Hi, Could anyone help me with a reugular expression for a UK mobile phone number? So far I have tried

Re: [PHP] Regular Expression for a UK Mobile

2004-10-15 Thread Gareth Williams
You could add is_integer() into the if statement. On 15 Oct 2004, at 14:07, Robert Cummings wrote: On Fri, 2004-10-15 at 07:45, Gareth Williams wrote: Do you even need a regex? What about if (strlen($_POST['mobile_number']) != 11 substr($_POST['mobile_number'],0,3) != 447) { $error

Re: [PHP] splitting string into array

2004-09-29 Thread Gareth Williams
Try something like this: $string = 'A12B05C45D34'; $string = chunk_split($string, 3, ':'); //Should give you 'A12:B05:C45:D34'; $array = explode(:,$string); Cheers, Gareth On 29 Sep 2004, at 15:40, blackwater dev wrote: How can I take a string and create an array? Example, A12B05C45D34 I need to

Re: [PHP] Two people working on the same app / script?

2004-09-30 Thread Gareth Williams
There's a simple one abbreviation answer CVS. It's probably the widest used version control system in the world, and is integrated into XCode (if you are a Mac PHP developer). On 30 Sep 2004, at 10:24, Dave Carrera wrote: Hi List, Is there a simple solution for two or more people to work on the

Re: [PHP] Replace or regex?

2004-09-30 Thread Gareth Williams
Well, if you can do it without a regex, then it's always best, because the regex engine slows things down. On 30 Sep 2004, at 10:39, mario wrote: Hi all I have a string: ##CODE## and I want to replace that with a href=somewhere.php?id=CODECODE/a can u help? -- PHP General Mailing List

Re: [PHP] refresh page automaticly on PHP

2004-09-30 Thread Gareth Williams
Try header(); On 30 Sep 2004, at 14:09, welly limston wrote: how to make my page refresh automaticly? Can i use PHP function? what is it? - Do you Yahoo!? vote.yahoo.com - Register online to vote today! -- PHP General Mailing List

Re: [PHP] Stored procedures in Mysql

2004-09-30 Thread Gareth Williams
Not Really. On 30 Sep 2004, at 21:50, Sagar C Nannapaneni wrote: Hi folks, I wonder whether Mysql supports procedures and triggers :? /sagar -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php

Re: [PHP] Stored procedures in Mysql

2004-09-30 Thread Gareth Williams
Well, if you are running you own server at home, or have a dedicated server, you can install your own MySQL server, and use version 5, which has all this, but if you have a shared space, then you are probably running version 4.whatever, and don't have them. That's why I said not really,

Re: [PHP] general research question (maybe a little OT, sorry)

2004-10-07 Thread Gareth Williams
Oh please. Not even as a joke. On 7 Oct 2004, at 21:07, Matt M. wrote: My boss recently called PHP good for hobbyists but REAL sites have to be done with Microsoft technologies. He wants to use Sharepoint for a wiki type site because of versioning. :) real sites use iis -- PHP General Mailing

Re: [PHP] Array concatenation behaviour change

2004-10-08 Thread Gareth Williams
Can't you sort the array? On 8 Oct 2004, at 10:41, rich gray wrote: Just a heads up on this change in array concatenation behaviour that could cause a few probs for some people... ? $arr1 = array(0 = 'Zero'); $arr2 = array(1 = 'One',2 = 'Two'); $arr2 = $arr1 + $arr2; echo phpversion().'br /';

Re: [PHP] Simply open an URL

2004-10-09 Thread Gareth Williams
header(Location: url); On 9 Oct 2004, at 20:21, Armands Pucs wrote: Hi everyone! Sorry for the probably stupid question. But I can`t find a way to make a php script to open an url in a browser! Like script location = example.html; /script does. Armand from Latvia -- PHP General Mailing List

Re: [PHP] Confused with constructors

2004-11-19 Thread Gareth Williams
Try this: class base_object() { function base_object() { echo I'm the base; } function base_test() { echo I'm the base test; } } class extended_object() extends base_object { function extended_object()

Re: [PHP] Upload is not working ( Permission Problem), I tried a number of ways , still no success!!!!!

2004-12-01 Thread Gareth Williams
You could try chown user:group, where user and group are those apache runs in. Is this script running on your own machine, or on a web server hosted somewhere? On 1 Dec 2004, at 09:03, Michael Leung wrote: Hi all, I am still solving my upload script problems. Here is the error Msg: Warning:

Re: [PHP] Software patents

2004-12-01 Thread Gareth Williams
No On 1 Dec 2004, at 15:37, abrea wrote: Will the adoption and legalization of software patents actually threaten the activity of PHP software developers? I see some people quite worried about this, e.g. at http://www.knoppix.org and http://swpat.ffii.org/index.en.html Alberto Brea -- PHP

Re: [PHP] Magic Quotes Issue

2004-12-07 Thread Gareth Williams
Try $string = mysql_real_escape_string($string); On 7 Dec 2004, at 14:12, Shaun wrote: Hi, I have been investigating the problem of apostrphes in a mysql insert / update. I use a db_query function for all my queries: function db_query($query) { $qid = mysql_query($query); return $qid; } It

Re: [PHP] For Loop

2004-12-08 Thread Gareth Williams
What happens is (if I understand it correctly): First, PHP sets $i to equal 0, and then immediately sets $i to $months_arr_length. Every time the loop executes, it resets $1 to $months_arr_length, so you are stuck in an infinite loop. The reason behind this is you are using assignment equals

Re: [PHP] PHP vs JSP?

2004-12-11 Thread Gareth Williams
Because you prefer it? Seriously, you should choose what you are most happy with. Both work fine, although, PHP rocks! On 11 Dec 2004, at 10:11, Peter Lauri wrote: Best groupmember, Why should I choose PHP instead of JSP/Servlets when it comes to develop a high-traffic site. Assume that the

Re: [PHP] Loops

2004-12-14 Thread Gareth Williams
$result = mysql_query(SELECT name, description FROM table); while ($row = mysql_fetch_assoc($result)) { echo {$row['name']}br /$row['description']; } On 14 Dec 2004, at 16:52, Steve Marquez wrote: Greetings. I am trying to display looped information from a MySQL database in a PHP file.

Re: [PHP] header information problem

2004-12-18 Thread Gareth Williams
In the else part, you have the possibility to echo to the screen and later on, then header(Location: ...); This is the bit which isn't allowed. If you are doing header(Location: ...);, you are not allowed to echo before it. On 18 Dec 2004, at 11:52, Ahmed Abdel-Aliem wrote: Dear Groups