mike503 | 1 Jul 01:56 2008
Picon

Re: String to date

couldn't strtotime() do this without any mods? I personally would try
that first...

On 6/30/08, Mark Bomgardner <mbomgardner <at> kletc.org> wrote:
> I need to convert a date retrieved from user input to a mysql date.  Here
> the problem, I need to convert one of three possible combinations, either
> 01/01/2008,01-01-2008 or 01.01.2008.  I can't use explode because it's
> limited to one character to explode on.  I would prefer not to use regexp,
> but think I am going to have to.  The one part of the code that works below
> is using 01/01/2008 format.  Any suggestions
>
> echo $olddate = '06/06/2008';
> echo "<br />";
> echo $olddate2 = '06-16-2008';
> echo "<br />";
> echo $olddate3 = '06.26.2008';
> echo "<br />";
> echo $newdate = date("Y-m-d",strtotime($olddate));
> echo "<br />";
> echo $newdate2 = date("Y-m-d",strtotime($olddate2));
> echo "<br />";
> echo $newdate3 = date("Y-m-d",strtotime($olddate3));
>
> markb
>
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>
(Continue reading)

Chris | 1 Jul 02:00 2008
Picon

Re: can you give me example of website using postgresql database?


> I'm not sure what you're looking for in a RDMS, but the simple fact that you
> are having a hard time finding a robust, live site that uses PostgreSQL
> should scare you more than Sun's purchase of MySQL.

Just because you don't know any doesn't mean there aren't any.

Someone else pointed out this list on another mailing list:

http://people.planetpostgresql.org/xzilla/index.php?/archives/324-The-Big-Guys.html

Here's another good one:

http://highscalability.com/skype-plans-postgresql-scale-1-billion-users

Yahoo also just ran a story about a 2-petabyte db based on postgresql
(yes it's a modified db so not 100% postgresql).

http://www.informationweek.com/news/showArticle.jhtml?articleID=207801579&cid=feed-yahoo-news

-- 
Postgresql & php tutorials
http://www.designmagick.com/

--

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

Brian Dunning | 1 Jul 02:44 2008

Simple array problem

I'm trying to add a number to a value in an array. Pretend I have this:

$new_value = array('orange', 2);
$arr = array(
	array('blue', 4),
	array('orange', 5),
	array('green', 6));

I want to add the new value to the existing matching array element, so  
I end up with this:

$arr = array(
	array('blue', 4),
	array('orange', 7),
	array('green', 6));

Seems like it should be really simple but all the ways I can figure  
out to do it are too kludgey.

--

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

David Sky | 1 Jul 06:14 2008
Picon

Re: unset in foreach breaks recrusion

Hey,

Can't use your example, as you check weather
$sorted is empty, if it is -> run the foreach and return,
but on next recursion when it's not empty - do nothing :)

Though I found how to cut a few seconds (on very big array),
removing the first if, and adding a $return=true to functions'
parameters, and in future calls set it to false:

function recur($array, &$sorted=array(), $pid=0, $level=0, $return=true)
{
		foreach($array as $id=>$parent)
		{
			if($pid===$parent)
			{	
				$sorted[$id]= $level;
				unset($array[$id]);
				if(in_array($id,$array)){
					recur($array, &$sorted, $id, $level+1, false);
				}
			}
		}
		if($return){return $sorted;}
}

Well, I guess that's it, I'm sure I can think of
another way to cut execution time, but, well,
I don't have much time for it :)

(Continue reading)

zhiqi pan | 1 Jul 06:21 2008
Picon

Re: Re: exec() Error

use wget
exec("wget http://www.mysite.com/calculate.php");
Only execute the php programe from "web"
exec("/usr/bin/php /.../calculate.php")

2008/6/27 Boyd, Todd M. <tmboyd1 <at> ccis.edu>:

> > -----Original Message-----
> > From: Wei, Alice J. [mailto:ajwei <at> indiana.edu]
> > Sent: Thursday, June 26, 2008 7:50 AM
> > To: Boyd, Todd M.; php-general <at> lists.php.net
> > Subject: RE: Re: [PHP] exec() Error
> >
> > Hi, Todd:
> >
> >    It looks like I have some other errors in my Perl code, and I got
> it
> > fixed, switched the permission to 755, and made attempts to call it
> > using cURL through my working PHP script.
> >
> >    Here is the code:
> >
> > // create a new cURL resource
> > $ch = curl_init();
> >
> > // set URL and other appropriate options
> > curl_setopt($ch, CURLOPT_URL, "http://192.168.10.63/total.cgi");
> > curl_setopt($ch, CURLOPT_HEADER, false);
> >
> > // grab URL and pass it to the browser
(Continue reading)

ISO


Бизнес-процессы: проект по описанию и оптимизации
Семинар 10-11 июля, Москва 

В программе:
  Когда и кому   нужно описание бизнес-процессов 
Основные   методы описания &#8211; какой выбрать?  Анализ
орг.структуры   и процессов компании  Система
показателей   бизнес-процессов  ПО для формализации  
процессов  Реализация   проекта: рабочая группа,
последовательность   действий, аудит  Оптимизация  
бизнес-процессов 	 
	Каждая тема сопровождается разбором практики 

Для получения дополнительной информации пишите bprocess <at> betapost.eu
Или звоните
	
508-62-45&nbsp;&nbsp; и&nbsp;&nbsp;&nbsp; 	8-915-362-78-61

TS | 1 Jul 08:50 2008
Picon

REALLY NEWB QUESTION - include issue

Trying to "include()" a script from another domain on my server and it won't
let me do it.

I'm getting this error.

open_basedir restriction in effect. Operation not permitted etc...

Please help and stop laughing at me.

Thanks ahead, T

--

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

TS | 1 Jul 09:21 2008
Picon

RE: REALLY NEWB QUESTION - include issue

>Code segment?
>Exact error message? (Is there more context?)

Include (/file);

Function.include</a>]: open_basedir restriction in effect.
File(/var/www/vhosts/domain/httpdocs/file.php) is not within the allowed
path(s): (/var/www/vhosts/differentdomain/httpdocs:/tmp) in
/var/www/vhosts/samedifferentdomain/httpdocs/custom-template.php on line 151

It's my server and it makes perfect security sense because the package I'm
using allows me to resell but, I don't care about that particular security
issue since I'm not reselling. I'm assuming it's something in php.ini. It's
a linux machine. I'm not sure what else there is to tell. 

Thanks, T

-----Original Message-----
From: dhorton <at> iprimus.com.au [mailto:dhorton <at> iprimus.com.au] 
Sent: Tuesday, July 01, 2008 1:08 AM
To: TS
Subject: RE: [PHP] REALLY NEWB QUESTION - include issue

Code segment?
Exact error message? (Is there more context?)

I probably don't have the answer to answer you, but make like a little
easier
for those who might by giving them some information to work with.

(Continue reading)

Thijs Lensselink | 1 Jul 09:57 2008
Picon

RE: REALLY NEWB QUESTION - include issue

Quoting TS <sunnrunner <at> gmail.com>:

>> Code segment?
>> Exact error message? (Is there more context?)
>
> Include (/file);
>
> Function.include</a>]: open_basedir restriction in effect.
> File(/var/www/vhosts/domain/httpdocs/file.php) is not within the allowed
> path(s): (/var/www/vhosts/differentdomain/httpdocs:/tmp) in
> /var/www/vhosts/samedifferentdomain/httpdocs/custom-template.php on line 151
>
> It's my server and it makes perfect security sense because the package I'm
> using allows me to resell but, I don't care about that particular security
> issue since I'm not reselling. I'm assuming it's something in php.ini. It's
> a linux machine. I'm not sure what else there is to tell.
>
> Thanks, T
>
>
>
>
>
> -----Original Message-----
> From: dhorton <at> iprimus.com.au [mailto:dhorton <at> iprimus.com.au]
> Sent: Tuesday, July 01, 2008 1:08 AM
> To: TS
> Subject: RE: [PHP] REALLY NEWB QUESTION - include issue
>
> Code segment?
(Continue reading)

Thijs Lensselink | 1 Jul 10:19 2008
Picon

Re: Simple array problem

Quoting Brian Dunning <brian <at> briandunning.com>:

> I'm trying to add a number to a value in an array. Pretend I have this:
>
> $new_value = array('orange', 2);
> $arr = array(
> 	array('blue', 4),
> 	array('orange', 5),
> 	array('green', 6));
>
> I want to add the new value to the existing matching array element, so
> I end up with this:
>
> $arr = array(
> 	array('blue', 4),
> 	array('orange', 7),
> 	array('green', 6));
>
> Seems like it should be really simple but all the ways I can figure out
> to do it are too kludgey.
>
>
>

Just loop through the array to update. And use in_array to check if  
the key to update exists. Then you can do $array[$key][1] = $newValue.

Something like this maybe:

function updateArray(&$array, $update)
(Continue reading)


Gmane