php-general Digest 12 Nov 2006 17:40:42 -0000 Issue 4455

Topics (messages 244512 through 244523):

Re: How do you do the ? mark after a filename
        244512 by: John Meyer

Re: PEAR and MDB2
        244513 by: Alain Roger
        244517 by: Roman Neuhauser
        244521 by: Alain Roger
        244522 by: Alain Roger

Re: Staff log-in
        244514 by: IMADICA_MOKULEN

PEAR::MDB2 andquery
        244515 by: Alain Roger

Max File Upload Size
        244516 by: Tom Chubb
        244518 by: T.Lensselink

spot the mistake
        244519 by: Ross

Re: convert postgres date to PHP
        244520 by: Roman Neuhauser

PHP product licensing...
        244523 by: Jon Anderson

Administrivia:

To subscribe to the digest, e-mail:
        [EMAIL PROTECTED]

To unsubscribe from the digest, e-mail:
        [EMAIL PROTECTED]

To post to the list, e-mail:
        [email protected]


----------------------------------------------------------------------
--- Begin Message ---
the ? is a delimiter between the url and the get variables, which are
set by the script itself, either through forms or by scripts.
Thomas Bonham wrote:
> Hi All,
> 
> I keep seeing the ? mark after many file names index.php?id=234.
> 
> So what I would like to know is how do you make them. I have heard that
> they can make a programs life sampler when doing somethings with a
> database.
> 
> Thank you,
> 
> Thomas
> 

--- End Message ---
--- Begin Message ---
so when i have this code :
$options = array('debug'       => 2,
                                           'portability' =>
MDB2_PORTABILITY_ALL,
                                       );

   $query = 'SELECT * from sp_u_001(\'all\')';

   $db2 = & new MDB2_Driver_pgsql();
   $db2->connect($dsn);
   if (PEAR::isError($db2))
   {
       die("Error connection : ".$db2->getMessage());
   }

   $res = $db2->exec($query);
   if (PEAR::isError($res))
   {
       die("Error connection : ".$res->getMessage());
   }

i get this error ==> "Error connection : MDB2 Error: unknown error" (from
$res control)

Alain


On 11/11/06, Roman Neuhauser <[EMAIL PROTECTED]> wrote:

# [EMAIL PROTECTED] / 2006-11-11 12:02:37 +0100:
> require_once 'Pear/MDB2.php';
> $dsn = 'pgsql://login:[EMAIL PROTECTED]';
>
> $mdb2 =& MDB2::connect($dsn);
> if (PEAR::isError($mdb2))
> {
> die($mdb2->getMessage());
> }
>
> $res =& $mdb2->query('SELECT * FROM articles');

if (PEAR::isError($res))
{
die($res->getMessage());
}

> while ($row = $res->fetchRow(MDB2_FETCHMODE_ASSOC))
> {
> echo $row['title'] . ', ' . $row['content'] . "\n";
> }
> $res->free();

--
How many Vietnam vets does it take to screw in a light bulb?
You don't know, man.  You don't KNOW.
Cause you weren't THERE.             http://bash.org/?255991


--- End Message ---
--- Begin Message ---
# [EMAIL PROTECTED] / 2006-11-12 09:46:34 +0100:
> so when i have this code :
> $options = array('debug'       => 2,
>                                            'portability' =>
> MDB2_PORTABILITY_ALL,
>                                        );
> 
>    $query = 'SELECT * from sp_u_001(\'all\')';
> 
>    $db2 = & new MDB2_Driver_pgsql();
>    $db2->connect($dsn);
>    if (PEAR::isError($db2))
>    {
>        die("Error connection : ".$db2->getMessage());
>    }
> 
>    $res = $db2->exec($query);
>    if (PEAR::isError($res))
>    {
>        die("Error connection : ".$res->getMessage());
>    }
> 
> i get this error ==> "Error connection : MDB2 Error: unknown error" (from
> $res control)

http://pear.php.net/manual/en/package.database.mdb2.intro-query.php
says:

    exec() should be used for manipulation queries.

IOW, you should use query() for SELECTS, exec() for other statements.
Perhaps that's your problem?

-- 
How many Vietnam vets does it take to screw in a light bulb?
You don't know, man.  You don't KNOW.
Cause you weren't THERE.             http://bash.org/?255991

--- End Message ---
--- Begin Message ---
but the problem is before:
$mdb2 =& MDB2::connect($dsn);
                       if (PEAR::isError($mdb2))
                       {

die($mdb2->getMessage()."<br><br>".$db2->getUserinfo());
                       }

generate a :
MDB2 Error: not found connect: [Error message: extension pgsql is not
compiled into PHP]
** pgsql(pgsql)://login:[EMAIL PROTECTED]:5432/mydbname

how is it possible ?
when i control the php.ini and phpinfo() i see that pgsql is install and
activated.

So, what did i miss ?

Al.


On 11/12/06, Roman Neuhauser <[EMAIL PROTECTED]> wrote:

# [EMAIL PROTECTED] / 2006-11-12 09:46:34 +0100:
> so when i have this code :
> $options = array('debug'       => 2,
>                                            'portability' =>
> MDB2_PORTABILITY_ALL,
>                                        );
>
>    $query = 'SELECT * from sp_u_001(\'all\')';
>
>    $db2 = & new MDB2_Driver_pgsql();
>    $db2->connect($dsn);
>    if (PEAR::isError($db2))
>    {
>        die("Error connection : ".$db2->getMessage());
>    }
>
>    $res = $db2->exec($query);
>    if (PEAR::isError($res))
>    {
>        die("Error connection : ".$res->getMessage());
>    }
>
> i get this error ==> "Error connection : MDB2 Error: unknown error"
(from
> $res control)

http://pear.php.net/manual/en/package.database.mdb2.intro-query.php
says:

    exec() should be used for manipulation queries.

IOW, you should use query() for SELECTS, exec() for other statements.
Perhaps that's your problem?

--
How many Vietnam vets does it take to screw in a light bulb?
You don't know, man.  You don't KNOW.
Cause you weren't THERE.             http://bash.org/?255991





--
Alain
------------------------------------
Windows XP SP2
PostgreSQL 8.1.4
Apache 2.0.58
PHP 5

--- End Message ---
--- Begin Message ---
it does not matter, query or exec produce the same error message :
Error connection : MDB2 Error: not found         connect: [Error message:
extension pgsql is not compiled into PHP]

:-(

On 11/12/06, Roman Neuhauser <[EMAIL PROTECTED]> wrote:

# [EMAIL PROTECTED] / 2006-11-12 09:46:34 +0100:
> so when i have this code :
> $options = array('debug'       => 2,
>                                            'portability' =>
> MDB2_PORTABILITY_ALL,
>                                        );
>
>    $query = 'SELECT * from sp_u_001(\'all\')';
>
>    $db2 = & new MDB2_Driver_pgsql();
>    $db2->connect($dsn);
>    if (PEAR::isError($db2))
>    {
>        die("Error connection : ".$db2->getMessage());
>    }
>
>    $res = $db2->exec($query);
>    if (PEAR::isError($res))
>    {
>        die("Error connection : ".$res->getMessage());
>    }
>
> i get this error ==> "Error connection : MDB2 Error: unknown error"
(from
> $res control)

http://pear.php.net/manual/en/package.database.mdb2.intro-query.php
says:

    exec() should be used for manipulation queries.

IOW, you should use query() for SELECTS, exec() for other statements.
Perhaps that's your problem?

--
How many Vietnam vets does it take to screw in a light bulb?
You don't know, man.  You don't KNOW.
Cause you weren't THERE.             http://bash.org/?255991




--
Alain
------------------------------------
Windows XP SP2
PostgreSQL 8.1.4
Apache 2.0.58
PHP 5

--- End Message ---
--- Begin Message ---
Hello, everybody,

I read about the staff log-in interestingly.

> I need a little php script. Staff log in by entering username and
password
> and then the next time they enter their username and password they log
out.
> The script has to take down the time they log in and log out. Then I
should
> be able to read old log-ins and log-outs.
> 
> I unfortunately can't make it myself because I don't have the
knowledge, can
> anyone of you do this for me? It's for a small non-profit
orginisation.

If you want to learn about the security risk of "log-in&out-system"
quickly,you need to download a lot of free and non-free(the latter is
better)programs and to verify which part of the program was upgraded
(eg:v0.9 => v1.00 => v1.03)by the author of the program.

I am trying to keep the security of my poor php-login&out system by
setting properly my apache and my LAN and my kernel.It is impossible to
keep my log-in&out-program and my members information safely only by the
PHP program I wrote.If you want to keep your log-in&out-program and your
member information safely only by PHP program you wrote (eg:you are
going to provide your login&out-system for your members on a
rental-www-server), you need to get the programming-ability of "the
developer level of PHP".

You can verify on the amazon book-store if there is a book which
gathered the fragilitas of the log-in system ( whether or not it is
written in PHP ) .
The book about the fragilitas of the log-in&out system ( whether or not
it is written in PHP ) doesn't exist in Japan(yet).

Madoca

--- End Message ---
--- Begin Message ---
Hi,

I'm still wondering how are linked MDB2 class and MDB2_Driver_pgsql class.
when i analyze the code of DB.php and pgsql.php, it's clear that
DB.phpcheck a class based on phptype and therefore include the
pgsql.php file.

But i did not find something similar in MDB2.php.
i would like to understand how can i do execute a query via MDB2 class on a
postgreSQL DB.

here is my code and for sure it does not work.
the $db2->query(); is not a function from MDB2...only from MDB2_Driver_pgsql
class.


global $dsn;
$options = array('debug'       => 2,
                              'portability' => MDB2_PORTABILITY_ALL,
                              );

$query = 'SELECT * from sp_u_001(\'all\')';

$db2 = & new MDB2();
$db2->connect($dsn);
if (MDB2::isError($db2))
{
  die("Error connection :
".$db2->getMessage()."<br><br>".$res->getUserinfo());
}

$res =$db2->query($query);
if (MDB2::isError($res))
{
 die("Error connection :
".$res->getMessage()."<br><br>".$res->getUserinfo());
}

--
Alain
------------------------------------
Windows XP SP2
PostgreSQL 8.1.4
Apache 2.0.58
PHP 5

--- End Message ---
--- Begin Message ---
This is a really stupid question, but I've not been able to find an
answer for it.
I have always thought that your max upload size is limited to the
value in the php.ini file.
However I recently changed a site to a new server which had problems
with memory on one of the image resizing scripts.
I managed to work around it by inserting one line at the start of the
problem script:

ini_set("memory_limit","32M");

Can a similar thing be done with the upload_max_filesize?

Assuming that it can't, what is a good workaround? Using FTP within a script?
This is for uploading an audio file, typically 4MB.
Thanks in advance,

Tom

--- End Message ---
--- Begin Message ---
Have a look on this page for all the ini settings..
It will also say if it is changeable

http://nl2.php.net/manual/en/ini.php#ini.list


Tom Chubb wrote:
> This is a really stupid question, but I've not been able to find an
> answer for it.
> I have always thought that your max upload size is limited to the
> value in the php.ini file.
> However I recently changed a site to a new server which had problems
> with memory on one of the image resizing scripts.
> I managed to work around it by inserting one line at the start of the
> problem script:
> 
> ini_set("memory_limit","32M");
> 
> Can a similar thing be done with the upload_max_filesize?
> 
> Assuming that it can't, what is a good workaround? Using FTP within a
> script?
> This is for uploading an audio file, typically 4MB.
> Thanks in advance,
> 
> Tom
> 

--- End Message ---
--- Begin Message ---
echo ('<a  href="#"
onclick="window.open(\'news/old_news_list.php?month=$j&amp;year='.$i.'\',\'\',\'width=700,height=500\');
return false \" >$thisMonth</a>');


 I am trying to get this to open in a popup however it doess not open and I
cannot work out why. Must be a syntax arror as the page displays ok.


Ross

--- End Message ---
--- Begin Message ---
# [EMAIL PROTECTED] / 2006-11-11 16:59:19 +0100:
> Hi,
> 
> in my database PosgreSQL i have stored some date in the following format :
> YYYY-MM-DD HH:MM:SS
> 
> this is a real TimeStamp without time zone field format.
> 
> Under PHP i would like to display this field as text with the following
> format "DD.MM.YYYY"
> How can i do that ?

    http://www.postgresql.org/docs/8.1/static/functions-formatting.html

    Pay attention to the to_char() function.

-- 
How many Vietnam vets does it take to screw in a light bulb?
You don't know, man.  You don't KNOW.
Cause you weren't THERE.             http://bash.org/?255991

--- End Message ---
--- Begin Message --- I'll get right to the point, then explain after... I'm looking to release some PHP code as partially open-source. Basically a GPL-like license for non-commercial use, and proprietary license for anyone else.

I'm wondering about people's experience with various licenses (open-source or not). I'd be really glad to hear opinions and experiences about any successes and failures.

As for my reasoning:

As I understand it (correct me if I'm wrong), the GPL leaves some holes with regards to code used internally within a company (especially web stuff) where GPL'd PHP code can be used and changed internally by that company without returning changes even if the code is used in a public-facing website - so long as they don't re-distribute the software.

I've read through a bunch of other licenses, but I'm no lawyer. So rather than jumping blindly, I thought I'd seek out the opinions of those who've been there. There's no substitute for the concrete experience. :-)

I really like the idea of open-source software, so I would very much like to release my code so that it can benefit the open-source community, but make sure that commercial use is appropriately controlled at the same time.

Please reply to the list only, no need to cc.

Cheers,

jon

--- End Message ---

Reply via email to