Re: [PHP-DB] Re: Problem with query

2013-06-25 Thread Jim Giner

On 6/25/2013 2:32 AM, OJFR wrote:

Yeah, Jim, please explain what u mean by "Per the manual, associative arrays
using string indices should always use ' ' around them.  They work (as
mentioned in the manual) but are wrong". As long as I remember  I could use
associative arrays in that way (ex. $_SESSION['Cust_Num']). There's another
way to do that using string indices? Why do you say it's wrong? It's
obsolete?

If YOU had taken the time to check the manual as I DID, you would not 
have blown your top at me.  When I said 'per the manual', I meant it. It 
was not something I made up to taunt Ethan with - it was from the place 
all of us here quote on a regular basis.


Apology accepted.

And if you were a regular participant in this helpful forum, you would 
know of my attitude when dealing with Mr. Rosenberg, PhD.


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



Re: [PHP-DB] Re: Problem with query

2013-06-25 Thread Toby Hart Dyke


The original post is here:

http://news.php.net/php.db/48751

On 6/25/2013 1:02 PM, Michael Oki wrote:

I'm sorry I've not been following the last three responses. In a nutshell,
what "EXACTLY" does the poster of this issue want?


On 25 June 2013 11:06, Toby Hart Dyke  wrote:


What Jim means is here in the manual:

http://www.php.net/manual/en/**language.types.array.php#**
language.types.array.donts

In a nutshell:

Always use quotes around a string literal array index. For example,
/$foo['bar']/ is correct, while /$foo[bar]/ is not.

The reason is that without the quotes, you are generating an undefined
constant (bar) rather than using a string index ('bar'). It works, but
could have side effects in the future, so it's bad form to do it.

As for general politeness, you seem to be unaware of recent history in
this (an associated) groups. The OP has often committed the ultimate sine.
Not posting slightly wild code (we've all been/are there!) He doesn't seem
to listen or learn too well. Many posters (including Jim) have offered a
lot of of extremely good (and detailed) advice which seems to be rarely
taken...

   Toby



On 6/25/2013 7:32 AM, OJFR wrote:


Yeah, Jim, please explain what u mean by "Per the manual, associative
arrays
using string indices should always use ' ' around them.  They work (as
mentioned in the manual) but are wrong". As long as I remember  I could
use
associative arrays in that way (ex. $_SESSION['Cust_Num']). There's
another
way to do that using string indices? Why do you say it's wrong? It's
obsolete?

I would like to make a call to all the members of this mailing list:
knowledge is a wonderful gift so, why we don't share it politely and
efficiency. Jim, I will take you as an example. You start saying " Against
my better judgement, here I go again".






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



Re: [PHP-DB] Re: Problem with query

2013-06-25 Thread Jim Giner

On 6/25/2013 6:06 AM, Toby Hart Dyke wrote:


What Jim means is here in the manual:

http://www.php.net/manual/en/language.types.array.php#language.types.array.donts


In a nutshell:

Always use quotes around a string literal array index. For example,
/$foo['bar']/ is correct, while /$foo[bar]/ is not.

The reason is that without the quotes, you are generating an undefined
constant (bar) rather than using a string index ('bar'). It works, but
could have side effects in the future, so it's bad form to do it.

As for general politeness, you seem to be unaware of recent history in
this (an associated) groups. The OP has often committed the ultimate
sine. Not posting slightly wild code (we've all been/are there!) He
doesn't seem to listen or learn too well. Many posters (including Jim)
have offered a lot of of extremely good (and detailed) advice which
seems to be rarely taken...

   Toby


On 6/25/2013 7:32 AM, OJFR wrote:

Yeah, Jim, please explain what u mean by "Per the manual, associative
arrays
using string indices should always use ' ' around them.  They work (as
mentioned in the manual) but are wrong". As long as I remember  I
could use
associative arrays in that way (ex. $_SESSION['Cust_Num']). There's
another
way to do that using string indices? Why do you say it's wrong? It's
obsolete?

I would like to make a call to all the members of this mailing list:
knowledge is a wonderful gift so, why we don't share it politely and
efficiency. Jim, I will take you as an example. You start saying "
Against
my better judgement, here I go again".




My humble thanks for your timely support.  :)

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



Re: [PHP-DB] Re: Problem with query

2013-06-25 Thread Michael Oki
I'm sorry I've not been following the last three responses. In a nutshell,
what "EXACTLY" does the poster of this issue want?


On 25 June 2013 11:06, Toby Hart Dyke  wrote:

>
> What Jim means is here in the manual:
>
> http://www.php.net/manual/en/**language.types.array.php#**
> language.types.array.donts
>
> In a nutshell:
>
> Always use quotes around a string literal array index. For example,
> /$foo['bar']/ is correct, while /$foo[bar]/ is not.
>
> The reason is that without the quotes, you are generating an undefined
> constant (bar) rather than using a string index ('bar'). It works, but
> could have side effects in the future, so it's bad form to do it.
>
> As for general politeness, you seem to be unaware of recent history in
> this (an associated) groups. The OP has often committed the ultimate sine.
> Not posting slightly wild code (we've all been/are there!) He doesn't seem
> to listen or learn too well. Many posters (including Jim) have offered a
> lot of of extremely good (and detailed) advice which seems to be rarely
> taken...
>
>   Toby
>
>
>
> On 6/25/2013 7:32 AM, OJFR wrote:
>
>> Yeah, Jim, please explain what u mean by "Per the manual, associative
>> arrays
>> using string indices should always use ' ' around them.  They work (as
>> mentioned in the manual) but are wrong". As long as I remember  I could
>> use
>> associative arrays in that way (ex. $_SESSION['Cust_Num']). There's
>> another
>> way to do that using string indices? Why do you say it's wrong? It's
>> obsolete?
>>
>> I would like to make a call to all the members of this mailing list:
>> knowledge is a wonderful gift so, why we don't share it politely and
>> efficiency. Jim, I will take you as an example. You start saying " Against
>> my better judgement, here I go again".
>>
>
>


Re: [PHP-DB] Re: Problem with query

2013-06-25 Thread Toby Hart Dyke


What Jim means is here in the manual:

http://www.php.net/manual/en/language.types.array.php#language.types.array.donts

In a nutshell:

Always use quotes around a string literal array index. For example, 
/$foo['bar']/ is correct, while /$foo[bar]/ is not.


The reason is that without the quotes, you are generating an undefined 
constant (bar) rather than using a string index ('bar'). It works, but 
could have side effects in the future, so it's bad form to do it.


As for general politeness, you seem to be unaware of recent history in 
this (an associated) groups. The OP has often committed the ultimate 
sine. Not posting slightly wild code (we've all been/are there!) He 
doesn't seem to listen or learn too well. Many posters (including Jim) 
have offered a lot of of extremely good (and detailed) advice which 
seems to be rarely taken...


  Toby


On 6/25/2013 7:32 AM, OJFR wrote:

Yeah, Jim, please explain what u mean by "Per the manual, associative arrays
using string indices should always use ' ' around them.  They work (as
mentioned in the manual) but are wrong". As long as I remember  I could use
associative arrays in that way (ex. $_SESSION['Cust_Num']). There's another
way to do that using string indices? Why do you say it's wrong? It's
obsolete?

I would like to make a call to all the members of this mailing list:
knowledge is a wonderful gift so, why we don't share it politely and
efficiency. Jim, I will take you as an example. You start saying " Against
my better judgement, here I go again".




RE: [PHP-DB] Re: Problem with query

2013-06-24 Thread OJFR
Yeah, Jim, please explain what u mean by "Per the manual, associative arrays
using string indices should always use ' ' around them.  They work (as
mentioned in the manual) but are wrong". As long as I remember  I could use
associative arrays in that way (ex. $_SESSION['Cust_Num']). There's another
way to do that using string indices? Why do you say it's wrong? It's
obsolete?

I would like to make a call to all the members of this mailing list:
knowledge is a wonderful gift so, why we don't share it politely and
efficiency. Jim, I will take you as an example. You start saying " Against
my better judgement, here I go again". If it's against your better judgment
please don't go anywhere, your conscience is a good adviser. After that you
talked a little about standards and some manual. If you are not happy to
help people who make some mistakes regarding to programming standards, you
should inform them where they can find the glorious manual and what is the
correct syntax to do what people need to do. This is a better way to show to
others what you know in a humble way but I suppose that wasn't what you were
trying to do. I consider this list is to HELP others and share what we know.
"Never break the silence if it's not to make it better".

Ethan, I will check your problem and I'll write you back as soon as I can
'cause right now I don't have anything installed in my computer. I'll try to
do it tomorrow, ok? Be nice and stay well!!!

Osain.

-Mensaje original-
De: Ethan Rosenberg, PhD [mailto:erosenb...@hygeiabiomedical.com] 
Enviado el: domingo, junio 23, 2013 4:38 PM
Para: php-db@lists.php.net; Jim Giner
Asunto: [PHP-DB] Re: Problem with query

On 6/23/2013 2:31 PM, Ethan Rosenberg, PhD wrote:
> Dear List -
>
> There is an error in my query, and I cannot find it.
>
> This fails:
>
> $_SESSION['Cust_Num'] = $_REQUEST['cnum']; $_SESSION['CustNum'] = 
> $_REQUEST['cnum'];
>
> echo "session"; //this has the proper values print_r($_SESSION);
>
> $sql10 = "select Balance, Payments, Charges, Date from Charges where 
> Cust_Num = $_SESSION[Cust_Num] order by Date"; echo $sql10; //echos 
> the correct query
> $result10 = mysqli_query($cxn, $sql10); var_dump($result1); // this 
> returns NULL

Against my better judgement, here I go again.

Is this the "actual" code you executed, or is it once again a typeover?

Your 1st error is in these two lines:
> $result10 = mysqli_query($cxn, $sql10); var_dump($result1); // this 
> returns NULL

Yes your dump returns null.  And always will.


Any further errors might be related to your non-standard syntax for the
session variable.  Per the manual, associative arrays using string indices
should always use ' ' around them.  They work (as mentioned in the manual)
but are wrong.
===
Jim -


Is this the "actual" code you executed, or is it once again a typeover?

The actual code

Any further errors might be related to your non-standard syntax for the
session variable.  Per the manual, associative arrays using string indices
should always use ' ' around them.  They work (as mentioned in the manual)
but are wrong.

Newbie is confused.

Please explain.

TIA

Ethan

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


--

Este mensaje le ha llegado mediante el servicio de correo electronico que 
ofrece Infomed para respaldar el cumplimiento de las misiones del Sistema 
Nacional de Salud. La persona que envia este correo asume el compromiso de usar 
el servicio a tales fines y cumplir con las regulaciones establecidas

Infomed: http://www.sld.cu/


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



Re: [PHP-DB] Re: Problem with query

2013-06-23 Thread Richard Quadling
On 23 June 2013 21:37, Ethan Rosenberg, PhD  wrote:

> On 6/23/2013 2:31 PM, Ethan Rosenberg, PhD wrote:
>
>> Dear List -
>>
>> There is an error in my query, and I cannot find it.
>>
>> This fails:
>>
>> $_SESSION['Cust_Num'] = $_REQUEST['cnum'];
>> $_SESSION['CustNum'] = $_REQUEST['cnum'];
>>
>> echo "session"; //this has the proper values
>> print_r($_SESSION);
>>
>> $sql10 = "select Balance, Payments, Charges, Date from Charges where
>> Cust_Num = $_SESSION[Cust_Num] order by Date";
>> echo $sql10; //echos the correct query
>> $result10 = mysqli_query($cxn, $sql10);
>> var_dump($result1); // this returns NULL
>>
>
> Against my better judgement, here I go again.
>
> Is this the "actual" code you executed, or is it once again a typeover?
>
> Your 1st error is in these two lines:
>
>> $result10 = mysqli_query($cxn, $sql10);
>>
>> var_dump($result1); // this returns NULL
>>
>
> Yes your dump returns null.  And always will.
>
>
> Any further errors might be related to your non-standard syntax for the
> session variable.  Per the manual, associative arrays using string indices
> should always use ' ' around them.  They work (as mentioned in the manual)
> but are wrong.
>  ===
> Jim -
>
>
>
> Is this the "actual" code you executed, or is it once again a typeover?
>
> The actual code
>
>
> Any further errors might be related to your non-standard syntax for the
> session variable.  Per the manual, associative arrays using string indices
> should always use ' ' around them.  They work (as mentioned in the manual)
> but are wrong.
>
> Newbie is confused.
>
> Please explain.


Try ...

 $sql10 = "select Balance, Payments, Charges, Date from Charges where Cust_Num
= {$_SESSION['Cust_Num']} order by Date";


-- 
Richard Quadling
Twitter : @RQuadling
EE : http://e-e.com/M_248814.html
Zend : http://bit.ly/9O8vFY


[PHP-DB] Re: Problem with query

2013-06-23 Thread Ethan Rosenberg, PhD

On 6/23/2013 2:31 PM, Ethan Rosenberg, PhD wrote:

Dear List -

There is an error in my query, and I cannot find it.

This fails:

$_SESSION['Cust_Num'] = $_REQUEST['cnum'];
$_SESSION['CustNum'] = $_REQUEST['cnum'];

echo "session"; //this has the proper values
print_r($_SESSION);

$sql10 = "select Balance, Payments, Charges, Date from Charges where
Cust_Num = $_SESSION[Cust_Num] order by Date";
echo $sql10; //echos the correct query
$result10 = mysqli_query($cxn, $sql10);
var_dump($result1); // this returns NULL


Against my better judgement, here I go again.

Is this the "actual" code you executed, or is it once again a typeover?

Your 1st error is in these two lines:

$result10 = mysqli_query($cxn, $sql10);
var_dump($result1); // this returns NULL


Yes your dump returns null.  And always will.


Any further errors might be related to your non-standard syntax for the 
session variable.  Per the manual, associative arrays using string 
indices should always use ' ' around them.  They work (as mentioned in 
the manual) but are wrong.

===
Jim -


Is this the "actual" code you executed, or is it once again a typeover?

The actual code

Any further errors might be related to your non-standard syntax for the 
session variable.  Per the manual, associative arrays using string 
indices should always use ' ' around them.  They work (as mentioned in 
the manual) but are wrong.


Newbie is confused.

Please explain.

TIA

Ethan

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



[PHP-DB] Re: Problem with query

2013-06-23 Thread Jim Giner

On 6/23/2013 2:31 PM, Ethan Rosenberg, PhD wrote:

Dear List -

There is an error in my query, and I cannot find it.

This fails:

$_SESSION['Cust_Num'] = $_REQUEST['cnum'];
$_SESSION['CustNum'] = $_REQUEST['cnum'];

echo "session"; //this has the proper values
print_r($_SESSION);

$sql10 = "select Balance, Payments, Charges, Date from Charges where
Cust_Num = $_SESSION[Cust_Num] order by Date";
echo $sql10; //echos the correct query
$result10 = mysqli_query($cxn, $sql10);
var_dump($result1); // this returns NULL


Against my better judgement, here I go again.

Is this the "actual" code you executed, or is it once again a typeover?

Your 1st error is in these two lines:
> $result10 = mysqli_query($cxn, $sql10);
> var_dump($result1); // this returns NULL

Yes your dump returns null.  And always will.


Any further errors might be related to your non-standard syntax for the 
session variable.  Per the manual, associative arrays using string 
indices should always use ' ' around them.  They work (as mentioned in 
the manual) but are wrong.


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



[PHP-DB] Re: Problem with mysql and php

2012-01-08 Thread Jim Giner
Sounds to me like you really need to study database design.  30 years of 
doing it professionally, never heard of a design that involved what you are 
suggesting.   Good luck!



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



[PHP-DB] Re: Problem with mysql and php

2011-11-29 Thread David Robley
Jason Pruim wrote:

> Given the following 2 queries:
> 
> "SELECT DISTINCT areacode FROM main WHERE state = '{$query_exploded[0]}'";
> 
> "SELECT DISTINCT areacode FROM main";
> 
> The second displays ALOT faster Like by minutes... the first one is
> what I really want though Currently working with a dataset of 89
> million records, will be expanding that to many many more times that... To
> the tune of possibly a couple billion records...
> 
> Any ideas? :)
> 
> 
> Jason Pruim
> li...@pruimphotography.com

Absolutely the first thing I would do is an EXPLAIN on the slow query, and
work from the results of that. I'd hazard a guess that there might be
indexing problems.

http://dev.mysql.com/doc/refman/5.1/en/using-explain.html


Cheers
-- 
David Robley

Insert inevitable trivial witticism of your choice.
Today is Pungenday, the 41st day of The Aftermath in the YOLD 3177. 


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



Re: [PHP-DB] Re: problem in connecting to mysql from php

2011-06-13 Thread Richard Quadling
On 13 June 2011 15:28, C0mf0rtably Numb <08.kus...@gmail.com> wrote:
> My php and apache are working fine together. I was doing good with php and
> apache until I decided to work with mysql. I will have a look at all the
> links you provided and see if gives me a solution. Thanks.
>
> On Mon, Jun 13, 2011 at 7:36 PM, Richard Quadling 
> wrote:
>>
>> On 13 June 2011 14:12, C0mf0rtably Numb <08.kus...@gmail.com> wrote:
>> > Any help?
>> >
>> > On Mon, Jun 13, 2011 at 5:38 PM, C0mf0rtably Numb
>> > <08.kus...@gmail.com>wrote:
>> >
>> >> Hello everyone,
>> >>
>> >> I am in the process of learning php and I was trying to connect to a
>> >> mysql
>> >> database on my own computer(localhost). I have done the following as
>> >> prerequisites:
>> >>
>> >> copied the dll files in system32
>> >> removed the semicolon(;) from extension=php_mysqli.dll
>> >>
>> >> In spite of doing the above when I try to run the following :
>> >>
>> >> > >> $db = new MySQLi('localhost', 'root', 'Password123', 'test');
>> >> $sql = 'SELECT * FROM a123';
>> >> $result = $db->query($sql);
>> >>
>> >> while($row = $result->fetch_object()) {
>> >>     echo '' . $row->name . '';
>> >> }
>> >>
>> >> $db->close();
>> >> ?>
>> >>
>> >> I get the error: *Fatal error*: Class 'MySQLi' not found in *C:\Program
>> >> Files\Apache Software Foundation\Apache2.2\htdocs\a.php* on line *2
>> >>
>> >> *Please guide me as to how can I get rid of this error?
>> >>
>> >> Regards,
>> >> Kushal
>> >>
>> >
>>
>> If you are able to reset your system and then read through the manual
>> Windows installation documentation at
>> http://uk.php.net/manual/en/install.windows.manual.php
>>
>> Personally, I'd change the path to C:\PHP5,x,y, where the x and y are
>> the complete version numbers (PHP5.3.6) , but that's me. I then use
>> Junction to create C:\PHP5 which maps to C:\PHP5.3.6.
>>
>> Junction is like a link at least in terms of how I use it.
>>
>> I'd also take a good look at
>> http://uk.php.net/manual/en/install.windows.commandline.php and
>> http://uk.php.net/manual/en/install.windows.apache2.php
>>
>> One covers making better use of PHP from the command line and the
>> other deals with getting things working with Apache.
>>
>> And an issue. Please make sure you use the right version of PHP for
>> the version of Apache you are using. If you are using a VC9 build
>> Apache (say from ApacheLounge or something like that), then you can
>> use a VC9 build of PHP.
>>
>> If you are using an VC6 build, then you must use a VC6 build of PHP
>> and that limits you to PHP5.2 (PHP5.2.17 is the latest there). I use
>> IIS with FastCGI so I use a NTS (non thread safe) build. I don't know
>> which sort of threading model you need for Apache (hopefully it is
>> mentioned in one of the Apache related pages).
>>
>> And with regard to the php.ini file, you can make it available by many
>> different means.
>>
>> I use the registry. This is documented at
>> http://uk.php.net/manual/en/configuration.file.php
>>
>> Look at ...
>>
>> "As of PHP 5.2.0, the location of the php.ini file can be set for
>> different versions of PHP. The following registry keys are examined in
>> order: [HKEY_LOCAL_MACHINE\SOFTWARE\PHP\x.y.z],
>> [HKEY_LOCAL_MACHINE\SOFTWARE\PHP\x.y] and
>> [HKEY_LOCAL_MACHINE\SOFTWARE\PHP\x], where x, y and z mean the PHP
>> major, minor and release versions. If there is a value for IniFilePath
>> in these keys, then the first one found will be used as the location
>> of the php.ini (Windows only).
>>
>> [HKEY_LOCAL_MACHINE\SOFTWARE\PHP], value of IniFilePath (Windows only)."
>>
>> And, I think finally, if you need different php.ini files for apache
>> and the command line, ...
>>
>> "If php-SAPI.ini exists (where SAPI is used SAPI, so the filename is
>> e.g. php-cli.ini or php-apache.ini), it's used instead of php.ini.
>> SAPI name can be determined by php_sapi_name()."
>>
>> Richard.
>>
>> --
>> Richard Quadling
>> Twitter : EE : Zend : PHPDoc
>> @RQuadling : e-e.com/M_248814.html : bit.ly/9O8vFY : bit.ly/lFnVea
>
>

If you have PHP working, then create the following file and save it as
info.php in the docroot of your website.





When you load this, you'll see a list of settings being reported. The
important one in this instance is the value for the loaded
configuration file near the top of the page.

That's the INI file you are needing to edit.

Open it in your favourite text editor and look for the lines starting with ...

extension=

You need to choose which mysql driver you need - there are several.

mysql
myslqi
pdo_mysql


If you are using a modern mysql, then mysqli is the one to use. So,
add a line to the INI file that looks like ...

extension=php_mysqli.dll

It may already exist with a ; in front of it. Remove the ;

Save the ini.

Restart Apache.

You MAY need to reboot Windows.

Now load up the phpinfo() page again.

Do you see mysqli content?

If you do, then at that stage, the mysqli extension is loaded and you
can start using it : http://uk.php.net/man

Re: [PHP-DB] Re: problem in connecting to mysql from php

2011-06-13 Thread Richard Quadling
On 13 June 2011 14:12, C0mf0rtably Numb <08.kus...@gmail.com> wrote:
> Any help?
>
> On Mon, Jun 13, 2011 at 5:38 PM, C0mf0rtably Numb <08.kus...@gmail.com>wrote:
>
>> Hello everyone,
>>
>> I am in the process of learning php and I was trying to connect to a mysql
>> database on my own computer(localhost). I have done the following as
>> prerequisites:
>>
>> copied the dll files in system32
>> removed the semicolon(;) from extension=php_mysqli.dll
>>
>> In spite of doing the above when I try to run the following :
>>
>> > $db = new MySQLi('localhost', 'root', 'Password123', 'test');
>> $sql = 'SELECT * FROM a123';
>> $result = $db->query($sql);
>>
>> while($row = $result->fetch_object()) {
>>     echo '' . $row->name . '';
>> }
>>
>> $db->close();
>> ?>
>>
>> I get the error: *Fatal error*: Class 'MySQLi' not found in *C:\Program
>> Files\Apache Software Foundation\Apache2.2\htdocs\a.php* on line *2
>>
>> *Please guide me as to how can I get rid of this error?
>>
>> Regards,
>> Kushal
>>
>

If you are able to reset your system and then read through the manual
Windows installation documentation at
http://uk.php.net/manual/en/install.windows.manual.php

Personally, I'd change the path to C:\PHP5,x,y, where the x and y are
the complete version numbers (PHP5.3.6) , but that's me. I then use
Junction to create C:\PHP5 which maps to C:\PHP5.3.6.

Junction is like a link at least in terms of how I use it.

I'd also take a good look at
http://uk.php.net/manual/en/install.windows.commandline.php and
http://uk.php.net/manual/en/install.windows.apache2.php

One covers making better use of PHP from the command line and the
other deals with getting things working with Apache.

And an issue. Please make sure you use the right version of PHP for
the version of Apache you are using. If you are using a VC9 build
Apache (say from ApacheLounge or something like that), then you can
use a VC9 build of PHP.

If you are using an VC6 build, then you must use a VC6 build of PHP
and that limits you to PHP5.2 (PHP5.2.17 is the latest there). I use
IIS with FastCGI so I use a NTS (non thread safe) build. I don't know
which sort of threading model you need for Apache (hopefully it is
mentioned in one of the Apache related pages).

And with regard to the php.ini file, you can make it available by many
different means.

I use the registry. This is documented at
http://uk.php.net/manual/en/configuration.file.php

Look at ...

"As of PHP 5.2.0, the location of the php.ini file can be set for
different versions of PHP. The following registry keys are examined in
order: [HKEY_LOCAL_MACHINE\SOFTWARE\PHP\x.y.z],
[HKEY_LOCAL_MACHINE\SOFTWARE\PHP\x.y] and
[HKEY_LOCAL_MACHINE\SOFTWARE\PHP\x], where x, y and z mean the PHP
major, minor and release versions. If there is a value for IniFilePath
in these keys, then the first one found will be used as the location
of the php.ini (Windows only).

[HKEY_LOCAL_MACHINE\SOFTWARE\PHP], value of IniFilePath (Windows only)."

And, I think finally, if you need different php.ini files for apache
and the command line, ...

"If php-SAPI.ini exists (where SAPI is used SAPI, so the filename is
e.g. php-cli.ini or php-apache.ini), it's used instead of php.ini.
SAPI name can be determined by php_sapi_name()."

Richard.

-- 
Richard Quadling
Twitter : EE : Zend : PHPDoc
@RQuadling : e-e.com/M_248814.html : bit.ly/9O8vFY : bit.ly/lFnVea

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



[PHP-DB] Re: problem in connecting to mysql from php

2011-06-13 Thread C0mf0rtably Numb
Any help?

On Mon, Jun 13, 2011 at 5:38 PM, C0mf0rtably Numb <08.kus...@gmail.com>wrote:

> Hello everyone,
>
> I am in the process of learning php and I was trying to connect to a mysql
> database on my own computer(localhost). I have done the following as
> prerequisites:
>
> copied the dll files in system32
> removed the semicolon(;) from extension=php_mysqli.dll
>
> In spite of doing the above when I try to run the following :
>
>  $db = new MySQLi('localhost', 'root', 'Password123', 'test');
> $sql = 'SELECT * FROM a123';
> $result = $db->query($sql);
>
> while($row = $result->fetch_object()) {
> echo '' . $row->name . '';
> }
>
> $db->close();
> ?>
>
> I get the error: *Fatal error*: Class 'MySQLi' not found in *C:\Program
> Files\Apache Software Foundation\Apache2.2\htdocs\a.php* on line *2
>
> *Please guide me as to how can I get rid of this error?
>
> Regards,
> Kushal
>


Re: [PHP-DB] Re : Problem with PDO exceptions

2009-03-09 Thread Daniel Carrera

Neil Smith [MVP, Digital media] wrote:
When you create your DB connection $db, follow the connection line 
directly after with this :

$db->setAttribute(PDO::ATTR_ERRMODE , PDO::ERRMODE_EXCEPTION);

The default is I believe PDO::ERRMODE_SILENT which is confusing to most 
people the first time.



Thanks! It works now.

Cheers,
Daniel.

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



[PHP-DB] Re : Problem with PDO exceptions

2009-03-08 Thread Neil Smith [MVP, Digital media]



Message-ID: <49b2ce8f.1090...@theingots.org>
Date: Sat, 07 Mar 2009 20:44:15 +0100
From: Daniel Carrera 

Hello,

I have MySQL 5.1 and PHP 5.2. For some reason PDO is not throwing 
exceptions when I give it a broken SQL query. For example:


try {
$stmt = $db->prepare("SELECT * FROM foobar WHERE 1");
} catch(PDOException $e) {
error($e->getMessage());
}

In this example there is no table called 'foobar', so this should 
give an error. Yet, it doesn't.



When you create your DB connection $db, follow the connection line 
directly after with this :

$db->setAttribute(PDO::ATTR_ERRMODE , PDO::ERRMODE_EXCEPTION);

The default is I believe PDO::ERRMODE_SILENT which is confusing to 
most people the first time.

http://uk2.php.net/manual/en/pdo.setattribute.php


HTH
Cheers - Neil 




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



[PHP-DB] Re: Problem with Opera 9.0

2007-04-11 Thread Imran

Hi Logan,

Iam just looking at the javascript code. Will update you soon.

Best Regards,
Imran Khan

- Original Message - 
From: "Buesching, Logan J" <[EMAIL PROTECTED]>

To: "Imran" <[EMAIL PROTECTED]>; 
Sent: Wednesday, April 11, 2007 12:42 PM
Subject: RE: Problem with Opera 9.0 



Well, JavaScript interpreters are much different from IE to Firefox to
Opera, but as far as PHP goes, PHP outputs the same thing weather you
use Firefox, Opera, IE etc...

If you didn't have any browser specific PHP code, it would seem it is a
JavaScript problem.

-Logan

-Original Message-
From: Imran [mailto:[EMAIL PROTECTED] 
Sent: Wednesday, April 11, 2007 3:05 AM

To: Buesching, Logan J; php-db@lists.php.net
Subject: Re: Problem with Opera 9.0 


Hi Mr.Logan,

If i had a problem with Javascript  it shouldn't have worked with
Firefox 
right ? But it works fine with firefox.

Anyway iam checking with javascript code.

Best Regards,
Imran Khan

- Original Message - 
From: "Buesching, Logan J" <[EMAIL PROTECTED]>

To: "Imran" <[EMAIL PROTECTED]>; 
Sent: Wednesday, April 11, 2007 11:31 AM
Subject: RE: Problem with Opera 9.0


JavaScript issue?  I would assume it is an issue with JavaScript,
because PHP doesn't care what browser asks for data, unless your program
is hanging somewhere on a browser-specific issue.

-Logan

-Original Message-
From: Imran [mailto:[EMAIL PROTECTED]
Sent: Wednesday, April 11, 2007 1:43 AM
To: php-db@lists.php.net
Subject: Problem with Opera 9.0

Hello Everyone,



Iam having a strange problem with Opera 9.0.

I have a website where user can login to their admin panel. My site is
working fine in all the browser but when i use Opera 9.0 and enter the
username and password and click on submit, it niether goes to process
page nor show me any error message, it just keep loading the page for
hours...



Please Suggest.





Best Regards,
Imran Khan

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



[PHP-DB] RE: Problem with Opera 9.0

2007-04-11 Thread Buesching, Logan J
Well, JavaScript interpreters are much different from IE to Firefox to
Opera, but as far as PHP goes, PHP outputs the same thing weather you
use Firefox, Opera, IE etc...

If you didn't have any browser specific PHP code, it would seem it is a
JavaScript problem.

-Logan

-Original Message-
From: Imran [mailto:[EMAIL PROTECTED] 
Sent: Wednesday, April 11, 2007 3:05 AM
To: Buesching, Logan J; php-db@lists.php.net
Subject: Re: Problem with Opera 9.0 

Hi Mr.Logan,

If i had a problem with Javascript  it shouldn't have worked with
Firefox 
right ? But it works fine with firefox.
Anyway iam checking with javascript code.

Best Regards,
Imran Khan

- Original Message - 
From: "Buesching, Logan J" <[EMAIL PROTECTED]>
To: "Imran" <[EMAIL PROTECTED]>; 
Sent: Wednesday, April 11, 2007 11:31 AM
Subject: RE: Problem with Opera 9.0


JavaScript issue?  I would assume it is an issue with JavaScript,
because PHP doesn't care what browser asks for data, unless your program
is hanging somewhere on a browser-specific issue.

-Logan

-Original Message-
From: Imran [mailto:[EMAIL PROTECTED]
Sent: Wednesday, April 11, 2007 1:43 AM
To: php-db@lists.php.net
Subject: Problem with Opera 9.0

Hello Everyone,



Iam having a strange problem with Opera 9.0.

I have a website where user can login to their admin panel. My site is
working fine in all the browser but when i use Opera 9.0 and enter the
username and password and click on submit, it niether goes to process
page nor show me any error message, it just keep loading the page for
hours...



Please Suggest.





Best Regards,
Imran Khan

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



[PHP-DB] Re: Problem with Opera 9.0

2007-04-11 Thread Imran

Hi Mr.Logan,

If i had a problem with Javascript  it shouldn't have worked with Firefox 
right ? But it works fine with firefox.

Anyway iam checking with javascript code.

Best Regards,
Imran Khan

- Original Message - 
From: "Buesching, Logan J" <[EMAIL PROTECTED]>

To: "Imran" <[EMAIL PROTECTED]>; 
Sent: Wednesday, April 11, 2007 11:31 AM
Subject: RE: Problem with Opera 9.0


JavaScript issue?  I would assume it is an issue with JavaScript,
because PHP doesn't care what browser asks for data, unless your program
is hanging somewhere on a browser-specific issue.

-Logan

-Original Message-
From: Imran [mailto:[EMAIL PROTECTED]
Sent: Wednesday, April 11, 2007 1:43 AM
To: php-db@lists.php.net
Subject: Problem with Opera 9.0

Hello Everyone,



Iam having a strange problem with Opera 9.0.

I have a website where user can login to their admin panel. My site is
working fine in all the browser but when i use Opera 9.0 and enter the
username and password and click on submit, it niether goes to process
page nor show me any error message, it just keep loading the page for
hours...



Please Suggest.





Best Regards,
Imran Khan

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



[PHP-DB] RE: Problem with Opera 9.0

2007-04-10 Thread Buesching, Logan J
JavaScript issue?  I would assume it is an issue with JavaScript,
because PHP doesn't care what browser asks for data, unless your program
is hanging somewhere on a browser-specific issue. 

-Logan

-Original Message-
From: Imran [mailto:[EMAIL PROTECTED] 
Sent: Wednesday, April 11, 2007 1:43 AM
To: php-db@lists.php.net
Subject: Problem with Opera 9.0 

Hello Everyone,



Iam having a strange problem with Opera 9.0.

I have a website where user can login to their admin panel. My site is
working fine in all the browser but when i use Opera 9.0 and enter the
username and password and click on submit, it niether goes to process
page nor show me any error message, it just keep loading the page for
hours...



Please Suggest.





Best Regards,
Imran Khan

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



[PHP-DB] Re: Problem with ocilogon

2007-02-21 Thread Haydar Tuna
Hello,
 if you add your ENV variables for the oracle user (for example 
ORACLE_HOME, ORACLE_SID) in the Apache startup script, your problem will be 
solved.:) . You can create your your own Apache startup script 
/etc/rc.d/init.d folder after this step. You should create a link file. You 
can find many tutorials about Apache startup file on the web.
 By the way you can see your oracle env variables in the oracle user 
home directory .bash_profile file.


"Dominik Helle" <[EMAIL PROTECTED]> wrote in message 
news:[EMAIL PROTECTED]
> Hi,
>
> I've a problem with php-oci and I hope anybody can help me. I want to 
> connect with ocilogon to an Oracle Database. If i call my php-Script in 
> the browser, this error message turn up:
>
> Warning: ocilogon() [function.ocilogon]: OCIEnvNlsCreate() failed. There 
> is something wrong with your system - please check that ORACLE_HOME is set 
> and points to the right directory in...
>
> That is very funny, because if i activate the file on the command line - 
> the connect is possible and no error message turns up.
>
> FYI: My System:  Ubunutu 6, Apache 2 and php 5-with-oci & Oracle Database 
> 10g (10.1.0.2).
>
> Thank you for helping.
>
> Dominik 

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



Re: [PHP-DB] RE: Problem installing mssql extension

2006-01-25 Thread Frank M. Kromann
The MSSQL extension does not rely on MySQL in any way. The only required
DLL is ntwdblib.dll.

It would help if you could post any error messages or some sample code
that shows your problem.

The 'correct' installation is to copy ntwdblib.dll to windows\system32 on
the system that runs the PHP scripts. It's even better to install the MS
SQL Server Client libs. These are fouind on the MS SQL Server CD. This
will install the Query Analyzer that can be used to check the connection,
but it also installs tools that lets you configure the default protocol
(NetBios is default if you don't install these) and create Server
aliases.

- Frank

> mssql has a dependency on mysql.  Go figure. 
> 
> MySQL has some dependencies, also, although they are a little easier to
> find info on and do not require installing other extensions.  If you
> have the PHPRC system path set to your Windows PHP directory, you
should
> be OK.  Otherwise you may have to copy some additional files to the
> system32 directory.
> 
> -jim
> 
> -Original Message-
> From: Andrew Kleimeyer [mailto:[EMAIL PROTECTED] 
> Sent: Tuesday, January 24, 2006 10:56 PM
> To: php-db@lists.php.net
> Subject: Problem installing mssql extension
> 
> I've read all the documentation, and tried every suggestion, but I'm
> still unable to run the mssql extension.  When I uncomment the line in
> php.ini, PHP crashes.
> 
> My system:
> Windows 2000
> IIS 5.0
> PHP Version 5.1.2-dev
> 
> What I have tried:
> I've placed the ntwdblib.dll that came with php into the
winnt/system32/
> directory.  Nothing.
> I've placed the ntwdblib.dll that is running on my mssql machine into
> winnt/system32/ directory on the php machine.  Nothing.
> I've copied the php_mssql.dll into the winnt/system32/ directory on the
> php machine. Nothing.
> 
> Any ideas would be greatly appreciated.
> 
> --
> PHP Database Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
> 
> 

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



[PHP-DB] RE: Problem installing mssql extension

2006-01-25 Thread Jim McDonald
mssql has a dependency on mysql.  Go figure. 

MySQL has some dependencies, also, although they are a little easier to
find info on and do not require installing other extensions.  If you
have the PHPRC system path set to your Windows PHP directory, you should
be OK.  Otherwise you may have to copy some additional files to the
system32 directory.

-jim

-Original Message-
From: Andrew Kleimeyer [mailto:[EMAIL PROTECTED] 
Sent: Tuesday, January 24, 2006 10:56 PM
To: php-db@lists.php.net
Subject: Problem installing mssql extension

I've read all the documentation, and tried every suggestion, but I'm
still unable to run the mssql extension.  When I uncomment the line in
php.ini, PHP crashes.

My system:
Windows 2000
IIS 5.0
PHP Version 5.1.2-dev

What I have tried:
I've placed the ntwdblib.dll that came with php into the winnt/system32/
directory.  Nothing.
I've placed the ntwdblib.dll that is running on my mssql machine into
winnt/system32/ directory on the php machine.  Nothing.
I've copied the php_mssql.dll into the winnt/system32/ directory on the
php machine. Nothing.

Any ideas would be greatly appreciated.

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



[PHP-DB] Re: problem of transmitting variable from page to another page.

2005-12-03 Thread El Bekko

Mohamed Yusuf wrote:

 I am transmitting variable from one of my pages and I would like to match
that variable into mysql data. it won't return data.
my code is this.

$j |";
   if ($j == Z) {
   break;
  }
 } ?>
this code in my index page prints alphabetical letters from A-Z. and I woul
like to transmit that variable into my alpha.php page and select mysql
database what ever the value of $j is, but i have problem I can't figured
out what is wrong. can somebody help me.


Try

$j |";
if ($j == Z)
{
break;
}
}
?>

I'm using a similar thing, except my data comes from a database and then 
refers to a page. And it works fine (check 
http://icstrategy.midgetforhire.com/Strategies.php). If this doesn't 
work, it's odd :P


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



RE: [PHP-DB] Re: Problem with mysql_connect(...)

2005-09-20 Thread Dan
The reason that this worked for that message board is that they copied the
DLL into the system32 folder (which is in the windows path.)

The following can be found at http://us3.php.net/mysql and as you can see
from this article, moving that file to system32 will work however, not
recommended.

PHP 5+
MySQL is no longer enabled by default, so the php_mysql.dll DLL must be
enabled inside of php.ini. Also, PHP needs access to the MySQL client
library. A file named libmysql.dll is included in the Windows PHP
distribution and in order for PHP to talk to MySQL this file needs to be
available to the Windows systems PATH. See the FAQ titled "How do I add my
PHP directory to the PATH on Windows" for information on how to do this.
Although copying libmysql.dll to the Windows system directory also works
(because the system directory is by default in the system's PATH), it's not
recommended.


-Original Message-
From: viraj [mailto:[EMAIL PROTECTED] 
Sent: Tuesday, September 20, 2005 12:14 AM
To: Dan
Cc: Michael Louie Loria; php-db@lists.php.net
Subject: Re: [PHP-DB] Re: Problem with mysql_connect(...)

this is a dll issue; if you are running php5 on windows!

read this..

http://www.experts-exchange.com/Web/Web_Languages/PHP/PHP_Installation/Q_210
77014.html


~viraj.


On 9/19/05, Dan <[EMAIL PROTECTED]> wrote:
> If this is a windows computer, you might want to try adding C:\PHP (or
> whatever directory your PHP resides) into the path.  I read somewhere that
> this needs to be done for PHP5 and MySQL.  Not sure if it was true but
> seemed to clear up the problems I was having getting the 2 to talk to
either
> other.
> 
> 
> -Original Message-
> From: Michael Louie Loria [mailto:[EMAIL PROTECTED]
> Sent: Monday, September 19, 2005 2:19 AM
> To: php-db@lists.php.net
> Subject: [PHP-DB] Re: Problem with mysql_connect(...)
> 
> -BEGIN PGP SIGNED MESSAGE-
> Hash: SHA512
> 
> > Hello.
> >
> > I'm trying to connect to my MySQL server with mysql_connect(...). The
> server is up and running,
> and I'm running Apache with PHP properly installed. The code:
> >
> > $hleServer = mysql_connect($host, $user, $password)
> >  or die("Error: Database. Error code: 1. Contact the web master!");
> >
> > $host, $user, and $password are set to correct values (checked and
double
> checked). The funny
> thing is that not only does the function call fail, but I'm not even
getting
> the text defined by
> die("..."). It seems that the function call is more or less a black hole.
Of
> course the rest of
> the script doesn't execute either, I'm just left with a blank page.
> >
> > I didn't use to have this problem before (using PHP 5 now instead of 4).
> 
> check your configurations again. Try checking as if it was a fresh
> install of PHP5
> 
> php5apache2.dll is for PHP5
> 
> and probably you httpd.conf stills contains php4apache2.dll
> 
> Michael Louie Loria
> 
> 
> 
> -BEGIN PGP SIGNATURE-
> Comment: Public Key: https://www.biglumber.com/x/web?qs=0x4A256EC8
> Comment: Public Key: http://www.lorztech.com/GPG.txt
> Comment: Google, Skype, Yahoo ID: michaellouieloria
> 
> iQEVAwUBQy6Cd7XBHi2y3jwfAQpZ/Qf/WE5JesJT5FtecqonOOsgsHvEnWXatzWQ
> T/ajJxAcFXftSP8xbxs2z4HZqagwD05PIKN4Jqff+ibqY7zWp74J910ibyDNyHab
> Ui9StkzWuuNvmbg/N8QIlNXbxUqFIugjaJargKnPrtH2X8wl+nHJ1hZf4huQhrX9
> 7xJb3tgaI521IC8c+h+w1SIG5tt90Vcp6U9m21pnbwEfj01nky95JTuD1+6yWZD+
> pZlJ7qrFzTgbKKty1kshIG42wvPuDLrHBayb9+aKo5LeX/Qbfab7iueUMJDoNxAO
> j+NwG/x8R/qb5eqGuhcMNmYn+GxwiQdawk1c4hGj4nN6BGFsGf67vg==
> =VUIf
> -END PGP SIGNATURE-
> 
> 
> ---
> avast! Antivirus: Outbound message clean.
> Virus Database (VPS): 0537-2, 09/16/2005
> Tested on: 9/19/2005 5:18:51 PM
> avast! - copyright (c) 1988-2005 ALWIL Software.
> http://www.avast.com
> 
> 
> 
> 
> 
> --
> No virus found in this outgoing message.
> Checked by AVG Anti-Virus.
> Version: 7.0.344 / Virus Database: 267.11.1/104 - Release Date: 9/16/2005
> 
> 
> 
> 
> 
> __
> Yahoo! for Good
> Donate to the Hurricane Katrina relief effort.
> http://store.yahoo.com/redcross-donate3/
> 
> --
> PHP Database Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
> 
> --
> PHP Database Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
> 
>

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

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



Re: [PHP-DB] Re: Problem with mysql_connect(...)

2005-09-20 Thread viraj
this is a dll issue; if you are running php5 on windows!

read this..

http://www.experts-exchange.com/Web/Web_Languages/PHP/PHP_Installation/Q_21077014.html


~viraj.


On 9/19/05, Dan <[EMAIL PROTECTED]> wrote:
> If this is a windows computer, you might want to try adding C:\PHP (or
> whatever directory your PHP resides) into the path.  I read somewhere that
> this needs to be done for PHP5 and MySQL.  Not sure if it was true but
> seemed to clear up the problems I was having getting the 2 to talk to either
> other.
> 
> 
> -Original Message-
> From: Michael Louie Loria [mailto:[EMAIL PROTECTED]
> Sent: Monday, September 19, 2005 2:19 AM
> To: php-db@lists.php.net
> Subject: [PHP-DB] Re: Problem with mysql_connect(...)
> 
> -BEGIN PGP SIGNED MESSAGE-
> Hash: SHA512
> 
> > Hello.
> >
> > I'm trying to connect to my MySQL server with mysql_connect(...). The
> server is up and running,
> and I'm running Apache with PHP properly installed. The code:
> >
> > $hleServer = mysql_connect($host, $user, $password)
> >  or die("Error: Database. Error code: 1. Contact the web master!");
> >
> > $host, $user, and $password are set to correct values (checked and double
> checked). The funny
> thing is that not only does the function call fail, but I'm not even getting
> the text defined by
> die("..."). It seems that the function call is more or less a black hole. Of
> course the rest of
> the script doesn't execute either, I'm just left with a blank page.
> >
> > I didn't use to have this problem before (using PHP 5 now instead of 4).
> 
> check your configurations again. Try checking as if it was a fresh
> install of PHP5
> 
> php5apache2.dll is for PHP5
> 
> and probably you httpd.conf stills contains php4apache2.dll
> 
> Michael Louie Loria
> 
> 
> 
> -BEGIN PGP SIGNATURE-
> Comment: Public Key: https://www.biglumber.com/x/web?qs=0x4A256EC8
> Comment: Public Key: http://www.lorztech.com/GPG.txt
> Comment: Google, Skype, Yahoo ID: michaellouieloria
> 
> iQEVAwUBQy6Cd7XBHi2y3jwfAQpZ/Qf/WE5JesJT5FtecqonOOsgsHvEnWXatzWQ
> T/ajJxAcFXftSP8xbxs2z4HZqagwD05PIKN4Jqff+ibqY7zWp74J910ibyDNyHab
> Ui9StkzWuuNvmbg/N8QIlNXbxUqFIugjaJargKnPrtH2X8wl+nHJ1hZf4huQhrX9
> 7xJb3tgaI521IC8c+h+w1SIG5tt90Vcp6U9m21pnbwEfj01nky95JTuD1+6yWZD+
> pZlJ7qrFzTgbKKty1kshIG42wvPuDLrHBayb9+aKo5LeX/Qbfab7iueUMJDoNxAO
> j+NwG/x8R/qb5eqGuhcMNmYn+GxwiQdawk1c4hGj4nN6BGFsGf67vg==
> =VUIf
> -END PGP SIGNATURE-
> 
> 
> ---
> avast! Antivirus: Outbound message clean.
> Virus Database (VPS): 0537-2, 09/16/2005
> Tested on: 9/19/2005 5:18:51 PM
> avast! - copyright (c) 1988-2005 ALWIL Software.
> http://www.avast.com
> 
> 
> 
> 
> 
> --
> No virus found in this outgoing message.
> Checked by AVG Anti-Virus.
> Version: 7.0.344 / Virus Database: 267.11.1/104 - Release Date: 9/16/2005
> 
> 
> 
> 
> 
> __
> Yahoo! for Good
> Donate to the Hurricane Katrina relief effort.
> http://store.yahoo.com/redcross-donate3/
> 
> --
> PHP Database Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
> 
> --
> PHP Database Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
> 
>

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



RE: [PHP-DB] Re: Problem with mysql_connect(...)

2005-09-19 Thread Dan
If this is a windows computer, you might want to try adding C:\PHP (or
whatever directory your PHP resides) into the path.  I read somewhere that
this needs to be done for PHP5 and MySQL.  Not sure if it was true but
seemed to clear up the problems I was having getting the 2 to talk to either
other.


-Original Message-
From: Michael Louie Loria [mailto:[EMAIL PROTECTED] 
Sent: Monday, September 19, 2005 2:19 AM
To: php-db@lists.php.net
Subject: [PHP-DB] Re: Problem with mysql_connect(...)

-BEGIN PGP SIGNED MESSAGE-
Hash: SHA512

> Hello.
>
> I'm trying to connect to my MySQL server with mysql_connect(...). The
server is up and running,
and I'm running Apache with PHP properly installed. The code:
>
> $hleServer = mysql_connect($host, $user, $password)
>  or die("Error: Database. Error code: 1. Contact the web master!");
>
> $host, $user, and $password are set to correct values (checked and double
checked). The funny
thing is that not only does the function call fail, but I'm not even getting
the text defined by
die("..."). It seems that the function call is more or less a black hole. Of
course the rest of
the script doesn't execute either, I'm just left with a blank page.
>
> I didn't use to have this problem before (using PHP 5 now instead of 4).

check your configurations again. Try checking as if it was a fresh
install of PHP5

php5apache2.dll is for PHP5

and probably you httpd.conf stills contains php4apache2.dll

Michael Louie Loria



-BEGIN PGP SIGNATURE-
Comment: Public Key: https://www.biglumber.com/x/web?qs=0x4A256EC8
Comment: Public Key: http://www.lorztech.com/GPG.txt
Comment: Google, Skype, Yahoo ID: michaellouieloria

iQEVAwUBQy6Cd7XBHi2y3jwfAQpZ/Qf/WE5JesJT5FtecqonOOsgsHvEnWXatzWQ
T/ajJxAcFXftSP8xbxs2z4HZqagwD05PIKN4Jqff+ibqY7zWp74J910ibyDNyHab
Ui9StkzWuuNvmbg/N8QIlNXbxUqFIugjaJargKnPrtH2X8wl+nHJ1hZf4huQhrX9
7xJb3tgaI521IC8c+h+w1SIG5tt90Vcp6U9m21pnbwEfj01nky95JTuD1+6yWZD+
pZlJ7qrFzTgbKKty1kshIG42wvPuDLrHBayb9+aKo5LeX/Qbfab7iueUMJDoNxAO
j+NwG/x8R/qb5eqGuhcMNmYn+GxwiQdawk1c4hGj4nN6BGFsGf67vg==
=VUIf
-END PGP SIGNATURE-


---
avast! Antivirus: Outbound message clean.
Virus Database (VPS): 0537-2, 09/16/2005
Tested on: 9/19/2005 5:18:51 PM
avast! - copyright (c) 1988-2005 ALWIL Software.
http://www.avast.com





-- 
No virus found in this outgoing message.
Checked by AVG Anti-Virus.
Version: 7.0.344 / Virus Database: 267.11.1/104 - Release Date: 9/16/2005





__ 
Yahoo! for Good 
Donate to the Hurricane Katrina relief effort. 
http://store.yahoo.com/redcross-donate3/ 

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

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



[PHP-DB] Re: Problem with mysql_connect(...)

2005-09-19 Thread Michael Louie Loria
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA512

> Hello.
>
> I'm trying to connect to my MySQL server with mysql_connect(...). The server 
> is up and running,
and I'm running Apache with PHP properly installed. The code:
>
> $hleServer = mysql_connect($host, $user, $password)
>  or die("Error: Database. Error code: 1. Contact the web master!");
>
> $host, $user, and $password are set to correct values (checked and double 
> checked). The funny
thing is that not only does the function call fail, but I'm not even getting 
the text defined by
die("..."). It seems that the function call is more or less a black hole. Of 
course the rest of
the script doesn't execute either, I'm just left with a blank page.
>
> I didn't use to have this problem before (using PHP 5 now instead of 4).

check your configurations again. Try checking as if it was a fresh
install of PHP5

php5apache2.dll is for PHP5

and probably you httpd.conf stills contains php4apache2.dll

Michael Louie Loria



-BEGIN PGP SIGNATURE-
Comment: Public Key: https://www.biglumber.com/x/web?qs=0x4A256EC8
Comment: Public Key: http://www.lorztech.com/GPG.txt
Comment: Google, Skype, Yahoo ID: michaellouieloria

iQEVAwUBQy6Cd7XBHi2y3jwfAQpZ/Qf/WE5JesJT5FtecqonOOsgsHvEnWXatzWQ
T/ajJxAcFXftSP8xbxs2z4HZqagwD05PIKN4Jqff+ibqY7zWp74J910ibyDNyHab
Ui9StkzWuuNvmbg/N8QIlNXbxUqFIugjaJargKnPrtH2X8wl+nHJ1hZf4huQhrX9
7xJb3tgaI521IC8c+h+w1SIG5tt90Vcp6U9m21pnbwEfj01nky95JTuD1+6yWZD+
pZlJ7qrFzTgbKKty1kshIG42wvPuDLrHBayb9+aKo5LeX/Qbfab7iueUMJDoNxAO
j+NwG/x8R/qb5eqGuhcMNmYn+GxwiQdawk1c4hGj4nN6BGFsGf67vg==
=VUIf
-END PGP SIGNATURE-


---
avast! Antivirus: Outbound message clean.
Virus Database (VPS): 0537-2, 09/16/2005
Tested on: 9/19/2005 5:18:51 PM
avast! - copyright (c) 1988-2005 ALWIL Software.
http://www.avast.com





-- 
No virus found in this outgoing message.
Checked by AVG Anti-Virus.
Version: 7.0.344 / Virus Database: 267.11.1/104 - Release Date: 9/16/2005





__ 
Yahoo! for Good 
Donate to the Hurricane Katrina relief effort. 
http://store.yahoo.com/redcross-donate3/ 

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



[PHP-DB] Re: problem with php oracle on linux

2005-06-16 Thread PHP - NEWS

TEST your connection :

if ($c=OCILogon("user", "password", "db")) {
  echo "Successfully connected to Oracle.\n";
} else {
  $err = OCIError();
  echo "Oracle Connect Error " . $err[text];
}

if you have an error try to add other putenv() as :

putenv("ORACLE_BASE=/home/oracle");
putenv("ORACLE_HOME=/home/oracle/OraHome");
putenv("ORACLE_SID=TEST");
putenv("NLS_LANGUAGE=FRENCH_FRANCE.WE8ISO8859P1");
putenv("TNS_ADMIN=/home/oracle/OraHome/network/admin");
putenv("TNS_ADMIN=/home/oracle/OraHome/");
putenv("ORA_NLS33=/home/oracle/OraHome/ocommon/nls/admin/data");
putenv("LD_LIBRARY_PATH=/home/oracle/OraHome/lib:/home/oracle/OraHome/network/l$
putenv("TWO_TASK=TEST-ORCL");

GL

Anom a écrit :
i have configured and compiled php 4.11 with oracle client 10g (not instant 
client) on linux and works fine. the client connects well with the oracle 
server which reside on other machine.


but the problem arise when i used php, i've got the following warning :
*Warning*: ocilogon(): _oci_open_server: Error while trying to retrieve text 
for error ORA-12154


what have i missed? i've set the ORACLE_HOME and ORACLE_SID env variable in 
the linux box.


well i hope someone could help me solve the problem.

TiA



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



[PHP-DB] solved [Re: [PHP-DB] Re: Problem with mysql_fetch_array after first loop...]

2005-03-03 Thread Jeffrey Baumgartner
That was indeed the problem and of course I should have seen it myself!
Thanks very much, Jochem.
Jeffrey
Jochem Maas wrote:
Steve McGill wrote:
"Jeffrey Baumgartner" <[EMAIL PROTECTED]> schreef in bericht
news:[EMAIL PROTECTED]
I've made a little programme that deletes expired records from database
tables. The troublesome bit looks like this...
   $query = "SELECT ic FROM ic_ic WHERE date <= CURDATE()";
   $result = mysql_query($query) or die("Unable to get old
campaigns because " . mysql_error());
   while ($row = mysql_fetch_array($result)){
   extract($row);
...delete records from tables where ic = ic


are you by any chance doing a query inside this while loop?
if you are then make sure you assign the result of the call to 
mysql_query()
to a variable that is NOT called $result.

  }
It works fine for the fitst value of $ic, but on the second time around
I get an error message saying that line [starting with "while..."] is
not a valid MySQL resource. This really puzzles me because it works one
time around, but not after that.

print_r(), var_dump() (and plain echo or print) are your friends:
if you preceed the line starting 'while ($row =' with the following:
var_dump( $result );
and then also add such a statement at the bottom of your while code ie:
var_dump( $result );
while ($row = mysql_fetch_array($result)) {
extract($row); // not a good idea IMHO
// do your stuff
var_dump( $result );
}   

then you should see it change on the second call to var_dump(), which
will hopefully lead you to the code that changes the $result var when
you don't want it to change.
$ic, incidentally, is a string originally generated from the timestamp
(ie. getdate[0])  - could this be causing a problem?

Why don't you try it without using extract($row), and use 
$row[variable1]
$row[variable2] instead in your loops.
extract() pulls all the variables into the global namespace and can 
be quite
dangerous as it might overwrite other variables. (this might be whats
happening with the $result variable for example.
also, how does extract() behave when trying to convert the [0] [1] [2]
variables? you might be better off using mysql_fetch_assoc()

ditto, dont extract() in this situation - its a waste of a function 
call and a
waste of variable initialization... just use the values in the $row 
array directly... e.g.

echo $row['ic']; // this could have been $ic if you had called 
extract($row)

Best wishes,
Steve

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


Re: [PHP-DB] Re: Problem with mysql_fetch_array after first loop...

2005-03-03 Thread Jochem Maas
Steve McGill wrote:
"Jeffrey Baumgartner" <[EMAIL PROTECTED]> schreef in bericht
news:[EMAIL PROTECTED]
I've made a little programme that deletes expired records from database
tables. The troublesome bit looks like this...
   $query = "SELECT ic FROM ic_ic WHERE date <= CURDATE()";
   $result = mysql_query($query) or die("Unable to get old
campaigns because " . mysql_error());
   while ($row = mysql_fetch_array($result)){
   extract($row);
...delete records from tables where ic = ic

are you by any chance doing a query inside this while loop?
if you are then make sure you assign the result of the call to mysql_query()
to a variable that is NOT called $result.
  }
It works fine for the fitst value of $ic, but on the second time around
I get an error message saying that line [starting with "while..."] is
not a valid MySQL resource. This really puzzles me because it works one
time around, but not after that.
print_r(), var_dump() (and plain echo or print) are your friends:
if you preceed the line starting 'while ($row =' with the following:
var_dump( $result );
and then also add such a statement at the bottom of your while code ie:
var_dump( $result );
while ($row = mysql_fetch_array($result)) {
extract($row); // not a good idea IMHO
// do your stuff
var_dump( $result );
}   
then you should see it change on the second call to var_dump(), which
will hopefully lead you to the code that changes the $result var when
you don't want it to change.
$ic, incidentally, is a string originally generated from the timestamp
(ie. getdate[0])  - could this be causing a problem?

Why don't you try it without using extract($row), and use $row[variable1]
$row[variable2] instead in your loops.
extract() pulls all the variables into the global namespace and can be quite
dangerous as it might overwrite other variables. (this might be whats
happening with the $result variable for example.
also, how does extract() behave when trying to convert the [0] [1] [2]
variables? you might be better off using mysql_fetch_assoc()
ditto, dont extract() in this situation - its a waste of a function call 
and a
waste of variable initialization... just use the values in the $row array 
directly... e.g.
echo $row['ic']; // this could have been $ic if you had called extract($row)
Best wishes,
Steve
--
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


[PHP-DB] Re: Problem with mysql_fetch_array after first loop...

2005-03-03 Thread Steve McGill
"Jeffrey Baumgartner" <[EMAIL PROTECTED]> schreef in bericht
news:[EMAIL PROTECTED]
> I've made a little programme that deletes expired records from database
> tables. The troublesome bit looks like this...
>
> $query = "SELECT ic FROM ic_ic WHERE date <= CURDATE()";
> $result = mysql_query($query) or die("Unable to get old
> campaigns because " . mysql_error());
>
> while ($row = mysql_fetch_array($result)){
> extract($row);
>  ...delete records from tables where ic = ic
>}
>
> It works fine for the fitst value of $ic, but on the second time around
> I get an error message saying that line [starting with "while..."] is
> not a valid MySQL resource. This really puzzles me because it works one
> time around, but not after that.
>
> $ic, incidentally, is a string originally generated from the timestamp
> (ie. getdate[0])  - could this be causing a problem?

Why don't you try it without using extract($row), and use $row[variable1]
$row[variable2] instead in your loops.
extract() pulls all the variables into the global namespace and can be quite
dangerous as it might overwrite other variables. (this might be whats
happening with the $result variable for example.
also, how does extract() behave when trying to convert the [0] [1] [2]
variables? you might be better off using mysql_fetch_assoc()

Best wishes,
Steve

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



[PHP-DB] Re: Problem with an update after an insert: MySQL

2005-02-08 Thread Stefan Reimers
It would make things easier if you could determine the error, so try to 
use mysql_error after all your mysql_queries, not just after the first one.

Stefan
[EMAIL PROTECTED] wrote:
I'm having trouble with having trouble with doing an update after doing an  
insert on and a select on a table. The order of execution is:
 
 $result = mysql_query("select token from  tokenuserid where  userid = 
'$none' ");
if (!$result)
echo  mysql_error();
 
  $numresult = mysql_num_rows($result);
$row =  mysql_fetch_row($result);
$gotToken =  $row[0];

$generatedToken =  date(YmdHis);
$result = mysql_query("insert into tokenuserid  values ('$generatedToken', 
'$none')");
 
  $result = mysql_query("update tokenUserid set userid = '$userid'  where 
token = '$gotToken'");
if (!$result)
echo  "can't find user"; 
 
I can't get this update to take. Actually, I can get this to work on one  
implementation of this database and on the next implementation of this it  
doesn't work. returning the error after the update. The MySQL version is  3.23.52. 
Is it because I have a capital U in the name tokenUserid in the update  
statement? I could believe this as a reason since the table is defined as:  
tokenuserid - (without any caps). If this is the problem then why does it occur  in one 
implementation and not the other?

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


[PHP-DB] Re: Problem with permissions Win32 dba_open

2005-01-01 Thread Ian
Well - after much experimentation, hair-pulling, and chasing of red herrings 
I have discovered  the error of my ways.  :oD

Despite my 4 PHP reference books I eventually turned to the PHP Manual (in 
.chm form) and it seems that the dba_open() function was modified for PHP 
4.3.0 et seq, to include modifiers for the mode parameter, which handle 
database locking, ie 'l', 'd', '-' and 't'.

So, the solution to my problem was nothing at all to to with file 
permissions, security or sharing folders - it was DBA locking by default.

Along the way, some of you newbies may like know of a few other pit-falls:

1.  Using db3 as the handler, rather than inifile or flatfile, it's 
necessary to supply the _full_ path to your database file, rather than a 
relative path (which actually works with the other handlers).

2.  If the database parameter is supplied without a path (relative or 
otherwise), a lock file is placed into the folder from which the script is 
run, while the database file is planted squarely into the folder from which 
php.exe is executed, in my case C:\PHP.  Weird - took me a while to sus. 
that one!  (What about the setting of doc_root in php.ini?  Makes no 
difference.)

3. Use single, rather than double quotes for dba_open() parameters.  In my 
original test, I used double quotes (below) and, of course, \t was 
interpolated!

Cheers,
Ian
(New Year's resolution - RTFM!)

"Ian" <[EMAIL PROTECTED]> originally wrote:
> Hi all,  Season's Greetings!
>
> I am testing my PHP scripts locally under XP Home SP2 / Apache 1.3.23 / 
> PHP
> 4.3.10 but I can't get a simple DBM script to work.  No problem running it
> on my remote site, under Unix with gdbm though.
>
> Locally, phpinfo() gives:
>
> DBA support: enabled
> Supported handlers: cdb cdb_make db3 inifile flatfile
>
> This encourages me to think that I could open a database with db3, but I
> just can't get passed the dba_open command, which always fails with
> "Permission denied".
>
> $db = dba_open("C:\Apache\htdocs\test.db", "c" , "db3")  // for example
>
> What am I doing wrong please?
>
> Thanks for your help,
> Ian
>
> PS This appears to be a fixed bug (http://bugs.php.net/bug.php?id=28122) 
> but
> I still get "permission denied".  Why? 

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



[PHP-DB] Re: Problem compiling PHP 5 with MySQLi (64bit)

2004-11-18 Thread Sebastian Mendel
Sascha Noethen wrote:
Hi,
I am trying to compile PHP 5 with mysqli support:
./configure --with-mysqli
The result is an error message and I cannot find out how to avoid this 
error message:

checking for MySQLi support... yes
checking whether to enable embedded MySQLi support... no
checking for mysql_set_server_option in -lmysqlclient... no
configure: error: wrong mysql library version or lib not found. Check 
config.log for more information.

I am using PHP 5.0.2 and MySQL 4.1.7 for Intel EM64T.
Any hint what I can try?
MySQL-client installed ?
MySQL-shared installed ?
--
Sebastian Mendel
www.sebastianmendel.de www.warzonez.de www.tekkno4u.de www.nofetish.com
www.sf.net/projects/phpdatetimewww.sf.net/projects/phptimesheet
--
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


[PHP-DB] Re: problem in updating data

2004-06-28 Thread Torsten Roehr
>"Sukanto Kho" <[EMAIL PROTECTED]> wrote in message
news:[EMAIL PROTECTED]
>Hi All,
>
>I've created an function for update record in database's table.
>
>the function can handle all the record update from any table... with
parameter passed in .. like this :
>
>function update($table,$values,$condition)
>   { $link=$this->database();
> $fields = mysql_list_fields("wellindo", $table, $link);
>  $columns = mysql_num_fields($fields);
>  $field_values="";
> for ($i = 1; $i < $columns-1; $i++) {
> $field_values=$field_values.mysql_field_name($fields,
$i)."=".$values[$i].",";}
> $field_values=$field_values.mysql_field_name($fields,
$i)."=".$values[$i];
> $query = "UPDATE $table SET $field_values $condition";
>$this->query($query,$table);
> }
>the function will find all the fields of the table then update all the
data.
>
>the problem is that when there ar some fields that I dont want to update (I
still want to use the existed/old data )...
>so how do I do that...??
>
>eg : I hav record
>name   phone  country
>a  123England
>and i want to update only phone change to 234 what can do to set name
and country so that it still remain the old >data

Hi Sukanto,

you could change your values array to an associative array. This way you
don't need to get the field names from the table every time:

$values = array('field1' => 'myValue', 'field2' = 25);

Then you build your update statement by looping through this array and use
the array keys as the field names.

$field_values = '';

foreach ($values as $column => $value) {
$field_values .= (empty($field_values)) ? "SET $column = '$value'" : ",
SET $column = '$value'";
}

Hope this helps,

Torsten Roehr

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



Re: [PHP-DB] Re: problem....

2004-06-23 Thread Philip Thompson
I may be incorrect, but I do not think that by "redefining" the 
variable $pic is destroying its old contents. If you are familiar with 
how programming works, you realize that the "stuff" on the right side 
of the "=" sign is evaluated first, and then assigned to the left side 
of the "=" sign. Because $pic is in the mysql_fetch_array($pic) (on the 
right), $pic is evaluated before it ever gets "destroyed" by the 
redefining.

PHP may not be this way, but I think that it is. If I am incorrect, 
please let me know. I hope this helps out (with something).

~Philip
On Jun 23, 2004, at 11:47 AM, Cole S. Ashcraft wrote:
Kim,
Won't redefining the variable destroy the MySQL Resource, resulting in 
a resource invalid error, like he has?

$pic = mysql_query($sql,$connection); //Defines variable
$pic //Redefining variable, dumps old contents = //calling on an 
invalid MySQL Resource, because it doesn't exist 
mysql_fetch_array($pic);
My comments are in green.

Cole
Kim Steinhaug wrote:
Well, your query looked confusing to me, but break it up like this
First :
   select
Then, name your coloumns, seperate with commas, or use wildcard for 
all
   *
Define from what table you need to select
   FROM database_table
Add some select statements with WHERE
   WHERE
and the statements itself
   1=1

What did I just write now? Looking at your example I guess :
1. you need the coloumns : Rune, username
2. your table : RuneRunner
3. your select criteria : UserID=3
I would then write your SQL query as this :
$sql = "SELECT Rune, username FROM RuneRunner WHERE UserID=3";
Then you could do your code,
$pic = mysql_query($sql,$connection);
$pic = mysql_fetch_array($pic);
You would also want to add a database abstraction layer, as for 
debugging
purposes this will make your life much easier.

Your original code looks to correct if you rewrite it abit, like this 
:

SELECT RuneRunner_1.Rune, RuneRunner_1.username FROM RuneRunner 
RuneRunner_1
WHERE (RuneRunner_1.User_ID=3);

Not tested but it should work fine. On the other hand, the 
referencename
after the
table name should be a short one to make the statement much easier to 
read,
somthing like :

SELECT rr.Rune, rr.username FROM RuneRunner rr WHERE (rr.User_ID=3);
Then again, since you only have one table in your statement there is 
no need
for the reference name,
and since your WHERE clause is a single statement there is no need 
for the
paranthese either.
So you are still back to :

SELECT Rune, username FROM RuneRunner WHERE User_ID=3;
--
--
Kim Steinhaug
--
There are 10 types of people when it comes to binary numbers:
those who understand them, and those who don't.
--
www.steinhaug.com - www.easywebshop.no - www.webkitpro.com
--
"Water_foul" <[EMAIL PROTECTED]> wrote in message
news:[EMAIL PROTECTED]
why doesn't this work:
$pic=mysql_query('SELECT Rune, username FROM RuneRunner
RuneRunner_1 WHERE (User_ID = 3)',$connection);
$pic=mysql_fetch_array($pic);


--
This message has been scanned for viruses and
dangerous content by MailScanner, and is believed to be clean.
--
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php
--
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


Re: [PHP-DB] Re: problem....

2004-06-23 Thread Cole S. Ashcraft
Kim,
Won't redefining the variable destroy the MySQL Resource, resulting in a 
resource invalid error, like he has?

$pic = mysql_query($sql,$connection); //Defines variable
$pic //Redefining variable, dumps old contents = //calling on an invalid MySQL Resource, because it doesn't exist mysql_fetch_array($pic); 

My comments are in green.
Cole
Kim Steinhaug wrote:
Well, your query looked confusing to me, but break it up like this
First :
   select
Then, name your coloumns, seperate with commas, or use wildcard for all
   *
Define from what table you need to select
   FROM database_table
Add some select statements with WHERE
   WHERE
and the statements itself
   1=1
What did I just write now? Looking at your example I guess :
1. you need the coloumns : Rune, username
2. your table : RuneRunner
3. your select criteria : UserID=3
I would then write your SQL query as this :
$sql = "SELECT Rune, username FROM RuneRunner WHERE UserID=3";
Then you could do your code,
$pic = mysql_query($sql,$connection);
$pic = mysql_fetch_array($pic);
You would also want to add a database abstraction layer, as for debugging
purposes this will make your life much easier.
Your original code looks to correct if you rewrite it abit, like this :
SELECT RuneRunner_1.Rune, RuneRunner_1.username FROM RuneRunner RuneRunner_1
WHERE (RuneRunner_1.User_ID=3);
Not tested but it should work fine. On the other hand, the referencename
after the
table name should be a short one to make the statement much easier to read,
somthing like :
SELECT rr.Rune, rr.username FROM RuneRunner rr WHERE (rr.User_ID=3);
Then again, since you only have one table in your statement there is no need
for the reference name,
and since your WHERE clause is a single statement there is no need for the
paranthese either.
So you are still back to :
SELECT Rune, username FROM RuneRunner WHERE User_ID=3;
--
--
Kim Steinhaug
--
There are 10 types of people when it comes to binary numbers:
those who understand them, and those who don't.
--
www.steinhaug.com - www.easywebshop.no - www.webkitpro.com
--
"Water_foul" <[EMAIL PROTECTED]> wrote in message
news:[EMAIL PROTECTED]
 

why doesn't this work:
$pic=mysql_query('SELECT Rune, username FROM RuneRunner
RuneRunner_1 WHERE (User_ID = 3)',$connection);
$pic=mysql_fetch_array($pic);
   

 


--
This message has been scanned for viruses and
dangerous content by MailScanner, and is believed to be clean.
--
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


[PHP-DB] Re: problem....

2004-06-23 Thread Kim Steinhaug
Well, your query looked confusing to me, but break it up like this

First :
select
Then, name your coloumns, seperate with commas, or use wildcard for all
*
Define from what table you need to select
FROM database_table
Add some select statements with WHERE
WHERE
and the statements itself
1=1

What did I just write now? Looking at your example I guess :
1. you need the coloumns : Rune, username
2. your table : RuneRunner
3. your select criteria : UserID=3

I would then write your SQL query as this :

$sql = "SELECT Rune, username FROM RuneRunner WHERE UserID=3";

Then you could do your code,
$pic = mysql_query($sql,$connection);
$pic = mysql_fetch_array($pic);

You would also want to add a database abstraction layer, as for debugging
purposes this will make your life much easier.

Your original code looks to correct if you rewrite it abit, like this :

SELECT RuneRunner_1.Rune, RuneRunner_1.username FROM RuneRunner RuneRunner_1
WHERE (RuneRunner_1.User_ID=3);

Not tested but it should work fine. On the other hand, the referencename
after the
table name should be a short one to make the statement much easier to read,
somthing like :

SELECT rr.Rune, rr.username FROM RuneRunner rr WHERE (rr.User_ID=3);

Then again, since you only have one table in your statement there is no need
for the reference name,
and since your WHERE clause is a single statement there is no need for the
paranthese either.
So you are still back to :

SELECT Rune, username FROM RuneRunner WHERE User_ID=3;

--
--
Kim Steinhaug
--
There are 10 types of people when it comes to binary numbers:
those who understand them, and those who don't.
--
www.steinhaug.com - www.easywebshop.no - www.webkitpro.com
--

"Water_foul" <[EMAIL PROTECTED]> wrote in message
news:[EMAIL PROTECTED]
> why doesn't this work:
> $pic=mysql_query('SELECT Rune, username FROM RuneRunner
> RuneRunner_1 WHERE (User_ID = 3)',$connection);
> $pic=mysql_fetch_array($pic);

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



[PHP-DB] Re: Problem in passing the necessary variable.

2004-06-13 Thread franciccio
Ciao..hi, i would suggest to embed the html code in php like this:

";
?>

If it works let me know , bye

Francesco Basile
__

"Alessandro Folghera" <[EMAIL PROTECTED]> ha scritto nel messaggio
news:[EMAIL PROTECTED]
> Hi,
>
> I have developed a news system .. I can select to insert an image into the
> articles.
>
> The function to extract the image calling them by the "imgid" of images
> table is the following:
>
> function getImm() {
> ?>
>   
>  connect();
> $sql = "select * from images";
> $result = mysql_query($sql);
> while($row = mysql_fetch_array($result)) {
> printf("%s", $row["id_img"], $row["imgid"]);
> }
> ?>
>   
> 
> I'd like to be able to see the image before to publish the piece of news.
>
> I think about a window pop up with java in order to create a preview of
the
> image. The code follows:
>
>  onClick="window.open(this.href, this.target, 'width=200,height=250');
> return false;">
>
> The problem is that I can't pass the "imgid" to the href inspite of the
> 
>
> May someone tell me how to pass the id number in order to show me the
image
> or how may I solve the trouble?
>
> I hope someone will help me ...
>
> Sincerely,
> Alexander

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



[PHP-DB] Re: problem to connect mssql DB under iis6

2004-03-01 Thread yannig BEYET
tests under 4.3.4 and 4.3.3

"Yannig Beyet" <[EMAIL PROTECTED]> a écrit dans le message
de news:[EMAIL PROTECTED]
> Hi,
>
> I'am currently migrating my servers from nt4/IIS4 to Windows server
> 2003/IIS6, my db is under NT4/SQL7 Secondary domain controller,
>
> from iis4 no problem to access (guest user for the web site),
> from iis6, the only way to connect DB is to run the web site under domain
> administrator
>
> the problem exist for all my sites under PHP, no problem for sites in
asp...
> i use phpbb forum, for example...
>
> any idea ?
>
> -- 
> Yannig

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



[PHP-DB] Re: Problem with INSERT Query

2003-12-30 Thread Hadi

<[EMAIL PROTECTED]> wrote in message
news:[EMAIL PROTECTED]
>
>
> Hi all:
>
> Well, when i bring out the page with the drop down list it was able to
display
> all tutors' names from "tutor_name" column. Anyway here's a review of my
code
> (snip) again before i continue:
> --
-
> 
> $sql = "INSERT INTO class (class_code, tutor_name, edu_level,
timetable_day,
> timetable_time)
> VALUES
>
('$class_code','$tutor_name','$edu_level','$timetable_day','$timetable_time'
)";
>
>
> 
>
> 
> 
>
 $sqltutor = mysql_query("SELECT DISTINCT tutor_name FROM tutor ");
 while ($row = mysql_fetch_array($sqltutor))
 {
  print " " .$row
 ["tutor_name"]. " ";
>  }
>  $result = $db-> query($sql);
>
> ?>
> 
>
> 
> while($selected_tutor_name == $tutor_name)
> echo $_POST["tutor_name"];
>
How about
if ($tutor_name ){
echo $_POST["tutor_name"];
$sql = "INSERT INTO class (class_code, tutor_name, edu_level, timetable_day,
 timetable_time)
 VALUES

('$class_code','$tutor_name','$edu_level','$timetable_day','$timetable_time'
)";}

is it working?


Hadi

> ?>
>
> 
>
> --
-
>
> so when i submit the form, i am suppose to echo the values i have entered
into
> the field and then INSERT the values into DB (Queries stated above).
However i
> was able to echo all other values eg. class_code, edu_level, etc...but
> not "tutor_name"same thing happen when i do an INSERT, all other
values
> are inserted into DB but not $tutor_namewhy is this so???Really need
some
> help here...Anyway i have already specify a name to be reference :
>
> 
>
> and then I also did an echo of "tutor_name" being selected:
>
> while($selected_tutor_name == $tutor_name)
> echo $_POST["tutor_name"];
>
> All help are greatly appreciated =)
>
> Irin.

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



Re: [PHP-DB] RE: Problem

2003-11-06 Thread CPT John W. Holmes
From: "Jeremy Shovan" <[EMAIL PROTECTED]>

> All I did was rewrite it exactly the same as it was and the
> parse error disappeared. I have never seen anything quite
> like this before.

Seen this before. It's either the editor or a copy and paste operation
adding weird "invisible" characters. Major pain in the ass.

---John Holmes...

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



[PHP-DB] RE: Problem

2003-11-06 Thread Jeremy Shovan
I was able to get rid of the parse error, but what I saw causing the
error was a little strange.  All I did was delete the spaces between
your if statement and the bracket that follows ie. if( not if (
The next thing that I did was rewrote the line that says 'echo
"Open";' although I didn’t change the line. All I did was
rewrite it exactly the same as it was and the parse error disappeared.
I have never seen anything quite like this before. Theoretically your
code is correct. The only thing I can think of that would contribute to
your error is the editor that you are using. Maybe it is putting some
character between your 'if (' that looks like a space but really isn’t a
space.

-Original Message-
From: Jacob Hackamack [mailto:[EMAIL PROTECTED] 
Sent: Wednesday, November 05, 2003 8:00 PM
To: [EMAIL PROTECTED]
Subject: Problem

Currently there seems to be some problem with syntax of some sort, for
some
reason I keep getting thrown back parse errors, commenting out the lines
just moves the parse error line around.  If anybody has any help thanks
in
advance.


Physics Sign-Up Input';
echo '';
echo '';
echo '';
echo 'Welcome '.$Name.', ';
echo ' ';

$Space = '';
$Data = $dataRow[1] ;

echo'  Position';
echo'  Openings';
echo'   ';

while ( $dataRow = mysql_fetch_row ( $result ) ) {


if ($Space != $dataRow[3])

  {

  echo '  ';
  echo '  ';
  echo ''.$dataRow[3].'';
  $Space = $dataRow[3] ;
  
  }
  else
  {
 echo '';
  }


  if ($Data == "")

  {

  echo "Open";
  
  }
else
  {
 echo ''.$dataRow[1].'';
  }

}


echo '';
echo '';
echo '';
echo '';
echo '';


?>

Jacob

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



[PHP-DB] Re: Problem connecting to MySql database from php

2003-09-13 Thread Shadow
It can be set up in php.ini file  Find the appropriate section and uncomment
it

Shadow

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



[PHP-DB] Re: problem with starting a session

2003-07-15 Thread Ben Tauler
You cannot write anything out before the session_start() call.
The error tells you that you have written something at:

output started at c:\inetpub\wwwroot\ads4u\data_valid_fns.php:25

Check for any echo, print or html output before session_start()

Hope that helps,

Ben


"Ahmed Abdelaliem" <[EMAIL PROTECTED]> escribió en el mensaje
news:[EMAIL PROTECTED]
> hi,
> i have a problem with starting a session in the page that validates the
user
> input and sends it tothe database,
> when the user clicks register he gets this error
>
> Warning: session_start(): Cannot send session cookie - headers already
sent
> by (output started at c:\inetpub\wwwroot\ads4u\data_valid_fns.php:25) in
> c:\inetpub\wwwroot\ads4u\register_new.php on line 89
>
> Warning: session_start(): Cannot send session cache limiter - headers
> already sent (output started at
> c:\inetpub\wwwroot\ads4u\data_valid_fns.php:25) in
> c:\inetpub\wwwroot\ads4u\register_new.php on line 89
>
>
> and here is the code i wrote :
>
>   $email=$HTTP_POST_VARS['email'];
>  $passwd=$HTTP_POST_VARS['passwd'];
>  $passwd2=$HTTP_POST_VARS['passwd2'];
>  $title=$HTTP_POST_VARS['title'];
>  $name1=$HTTP_POST_VARS['name1'];
>  $name2=$HTTP_POST_VARS['name2'];
>  $phone=$HTTP_POST_VARS['phone'];
>  $mobile=$HTTP_POST_VARS['mobile'];
>  $address1=$HTTP_POST_VARS['address1'];
>  $address2=$HTTP_POST_VARS['address2'];
>  $town=$HTTP_POST_VARS['town'];
>  $pb=$HTTP_POST_VARS['pb'];
>  $country=$HTTP_POST_VARS['country'];
>  $occupation=$HTTP_POST_VARS['occupation'];
>
> session_start();
>
>
> if (!filled_out($HTTP_POST_VARS)){
> echo "You Haven't filled your registeration details correctly, Please
go
> back and try again";
> exit;
> }
>
> if (!valid_email($email)){
> echo "That is not a valid email address. Please go back and try
again.";
> exit;
> }
> if ($passwd != $passwd2){
> echo "The passwords you entered do not match - please go back and try
> again.";
> exit;
> }
>
> if (strlen($passwd)<6 || strlen($passwd) >16){
> echo "Your password must be between 6 and 16 characters Please go back
> and try again.";
> exit;
> }
>
>
>
>
> can anyone tell me please where is the problem and how to solve it,
>
> i test those scripts on my local server IIS, i use windows XP and last
> version of PHP and MYSQL,
>
>
>
>
> thanks
>
> _
> MSN 8 with e-mail virus protection service: 2 months FREE*
> http://join.msn.com/?page=features/virus
>



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



[PHP-DB] RE: Problem with 4.3.2

2003-06-16 Thread Ryan Jameson (USA)

Funny you should ask. I actually didn't try it on anything else. So I went back and 
tried a simple script and got the same message. Thanks for the idea. I haven't gotten 
any other feedback on this.

<>< Ryan

-Original Message-
From: Jacob Marble [mailto:[EMAIL PROTECTED]
Sent: Friday, June 13, 2003 12:14 PM
To: Ryan Jameson (USA)
Subject: Re: Problem with 4.3.2


Interesting.  They say the ISAPI module isn't production quality yet... we
use it, though, w/o problems.  We're running IIS on Win2000 and php 4.3.2.
Does it work besides the phpinfo() problem?

Jake

LandEZ

"Ryan Jameson" <[EMAIL PROTECTED]> wrote in message
news:[EMAIL PROTECTED]
More info... I only get that message in ISAPI mode. :-\

<>< Ryan

-Original Message-
From: Ryan Jameson (USA)
Sent: Thursday, June 12, 2003 11:10 AM
To: [EMAIL PROTECTED]
Subject: Problem with 4.3.2


When I change over to 4.3.2 I get this message from phpinfo();

The operating system cannot run %1.

... any ideas? Thanks...

<>< Ryan

Ryan Jameson
Software Development Services Manager
International Bible Society




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



[PHP-DB] Re: Problem with 4.3.2

2003-06-13 Thread Jacob Marble
Interesting.  They say the ISAPI module isn't production quality yet... we
use it, though, w/o problems.  We're running IIS on Win2000 and php 4.3.2.
Does it work besides the phpinfo() problem?

Jake

LandEZ

"Ryan Jameson" <[EMAIL PROTECTED]> wrote in message
news:[EMAIL PROTECTED]
More info... I only get that message in ISAPI mode. :-\

<>< Ryan

-Original Message-
From: Ryan Jameson (USA)
Sent: Thursday, June 12, 2003 11:10 AM
To: [EMAIL PROTECTED]
Subject: Problem with 4.3.2


When I change over to 4.3.2 I get this message from phpinfo();

The operating system cannot run %1.

... any ideas? Thanks...

<>< Ryan

Ryan Jameson
Software Development Services Manager
International Bible Society



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



[PHP-DB] RE: Problem with 4.3.2

2003-06-12 Thread Ryan Jameson (USA)
More info... I only get that message in ISAPI mode. :-\

<>< Ryan

-Original Message-
From: Ryan Jameson (USA) 
Sent: Thursday, June 12, 2003 11:10 AM
To: [EMAIL PROTECTED]
Subject: Problem with 4.3.2


When I change over to 4.3.2 I get this message from phpinfo();

The operating system cannot run %1. 

... any ideas? Thanks...

<>< Ryan

Ryan Jameson
Software Development Services Manager 
International Bible Society

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



[PHP-DB] Re: Problem

2003-03-08 Thread Edwin Boersma
Does not sound like a PHP problem to me, more like IIS. Try and find 
some system messages that relate to the link between the servers.

Edwin

Kiswa wrote:
Ok here is the problem.

At home i run an Apache server with php4
and the server its supposed to be run on is NT5 and iis with php4
The site is run on an access db through ODBC. It works fine at home where i
have a system link to the db.
On the iis server the admin created the same link but the damed thing
doesent work.
any suggestions would be great.

I dont know if there is any difference.





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


[PHP-DB] Re: Problem in the returnvalue of a function

2003-01-22 Thread Bayu Susiloadhy
that means the result is not right,
it happen when your query is failed,check your query,
mysql_error() can help 

Ruprecht Helms writes: 


Hi  Bayu Susiloadhy, 

thanks for your answer. 

  function select_price($product_id,$quantity) {

 --cut--

return True;
   }

 --cut--


in the meentime I change the code that not a boolevalue
was returned by the function. 

$q is my querystring and $db is the selected database. 

I insert the following: 

   $db->query($q);
$result=mysql_db_query($db,$q); 

while ($row = mysql_fetch_object($result))
{
$price = $row->product_price;
}
mysql_free_result($result);
echo "\n";
echo $q;  // to show the sql-statement in runtime - diagnostics
echo "\n";
return $price; 


By executing it I get two warnings  both "this is not a valid Mysql-result
resort". The disliked lines are the begin of the while-loop and an the
mysql_free_result($result)-command. 

How have I to change up the script to get the product_price related to the
price_group. 

Regards,
Ruprecht 


--
Ruprecht Helms IT-Service und Softwareentwicklung 

Tel/Fax.:  +49[0]7621 16 99 16
Homepage:  http://www.rheyn.de
email:  [EMAIL PROTECTED]
-- 

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






--
STOP doing things that
the computer can does!
--
&$BS 

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



[PHP-DB] Re: Problem in the returnvalue of a function

2003-01-21 Thread Ruprecht Helms

Hi  Bayu Susiloadhy,

thanks for your answer.

>>   function select_price($product_id,$quantity) {
>  --cut--
>> return True;
>>}
>  --cut--

in the meentime I change the code that not a boolevalue
was returned by the function.

$q is my querystring and $db is the selected database.

I insert the following:

   $db->query($q);
$result=mysql_db_query($db,$q);

while ($row = mysql_fetch_object($result))
{
$price = $row->product_price;
}
mysql_free_result($result);
echo "\n";
echo $q;  // to show the sql-statement in runtime - diagnostics
echo "\n";
return $price;


By executing it I get two warnings  both "this is not a valid Mysql-result
resort". The disliked lines are the begin of the while-loop and an the
mysql_free_result($result)-command.

How have I to change up the script to get the product_price related to the
price_group.

Regards,
Ruprecht


--
Ruprecht Helms IT-Service und Softwareentwicklung

Tel/Fax.:  +49[0]7621 16 99 16
Homepage:  http://www.rheyn.de
email:  [EMAIL PROTECTED]
--

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




[PHP-DB] Re: Problem in the returnvalue of a function

2003-01-20 Thread Bayu Susiloadhy
Ruprecht Helms writes: 

  function select_price($product_id,$quantity) {

--cut--

return True;
   }

--cut--

$price=$ps_product_price->select_price($cart[$i]["product_id"],$cart[$i]["quanti
ty"]);
   //printf("%.2f", $price["product_price"]); 

  printf("%.2f",$price);

you set the select_price function to return true instead of selected price 





--
STOP doing things that
the computer can does!
--
&$BS 

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



[PHP-DB] Re: problem with PHP+flash programming

2002-12-18 Thread Radovan Radic

"Hermanto Kurniawan" <[EMAIL PROTECTED]> wrote in message
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
> i have a problem with this flash actionscript :
> loadVariablesNum
> ("GuestBook.php?NumLow="+NumLow+"&NumHigh="+NumHigh+"&R="+random(999), 0);
>
> when i run this script i got an error message like this :
> error opening URL
"file:///C|/path/GuestBook.php?NumLow=0&NumHigh=10&R=470"
>
> does anyone know what is the problem with this script?
>

Maybe you should do this
loadVariablesNum("http://localhost/GuestBook.php?...";)
or when open html doc with embedded flash , open it via http://file.html

HTH,
Radovan



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




[PHP-DB] Re: Problem with dsn

2002-09-12 Thread Nick Gorham

Gian Michele wrote:
> I have installed on my computer :
> Apache 1.3
> Php 4.1.2
> Postgresql
> the rpm of odbc and the unixODBC.
> 
> I tried to connect to my database after done all configurations; I used 
> the function odbc_pconnect('name_of_my_database','','') and the system 
> gives me this error
> "Warning: SQL error: [unixODBC][Driver Manager]Data source name not 
> found, and no default driver specified, SQL state IM002 in SQLConnect in 
> /var/www/html/check_avviso2.php on line 5"
> 
> Does any body knows as set the DSN and the driver?
> 

Have a look in the docs on the unixODBC web site, there are details there.

You need to create a system DSN, and use the name of that DSN in your 
connect. Check that you can connect with isql before moving on to PHP.

--
Nick Gorham
Easysoft Limited


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




RE: [PHP-DB] Re: problem with php and unixODBC

2002-08-21 Thread Andrew Hill

Marten,

Look at the output of a phpinfo() when you have the putenv()'s - you can
see that there are a couple of different environments here.

Best regards,
Andrew Hill
Director of Technology Evangelism
OpenLink Software  http://www.openlinksw.com
Universal Data Access & Virtuoso Universal Server

-Original Message-
From: Marten Lehmann [mailto:[EMAIL PROTECTED]] 
Sent: Wednesday, August 14, 2002 4:59 AM
To: Nick Gorham
Cc: [EMAIL PROTECTED]
Subject: [PHP-DB] Re: problem with php and unixODBC

Hello,

> I know its a little late, but I have only just been pointed to your 
> posting, I would guess the error you are getting "database not found"
is 
> coming from the sybase driver, not the driver manager.

I solved the problem a week ago. It was just when I wanted to try iODBC 
when I saw some putenv()-lines in the examples. I put the appropriate 
lines in my php-script and then it worked. What I don't unterstand is: 
When I'm running isql in the shell I can connect to the 
remote-ressource. When I start apache in the same shell I can't connect 
through PHP, I first have to set the ODBCINSTINI and ODBCINI 
env-variables. Why don't I need them in the shell?

Regards
Marten

-- 
Variomedia IT-Service GmbH | Benzstrasse 22 | 14482 Potsdam
http://www.variomedia.de | Hotline: 0800-5588550 | Fax: 0331-7404043







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





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




[PHP-DB] Re: problem with php and unixODBC

2002-08-14 Thread Marten Lehmann

Hello,

> I know its a little late, but I have only just been pointed to your 
> posting, I would guess the error you are getting "database not found" is 
> coming from the sybase driver, not the driver manager.

I solved the problem a week ago. It was just when I wanted to try iODBC 
when I saw some putenv()-lines in the examples. I put the appropriate 
lines in my php-script and then it worked. What I don't unterstand is: 
When I'm running isql in the shell I can connect to the 
remote-ressource. When I start apache in the same shell I can't connect 
through PHP, I first have to set the ODBCINSTINI and ODBCINI 
env-variables. Why don't I need them in the shell?

Regards
Marten

-- 
Variomedia IT-Service GmbH | Benzstrasse 22 | 14482 Potsdam
http://www.variomedia.de | Hotline: 0800-5588550 | Fax: 0331-7404043







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




[PHP-DB] Re: problem with php and unixODBC

2002-08-13 Thread Nick Gorham

Marten Lehmann wrote:
> Hello,
> 
> my unixODBC-2.2.2 installation works fine. I tested the configuration 
> with a local and a remote ressource to a Sybase Adaptive Server Anywhere 
> database with isql (a testing tool of unixODBC). Thus the settings in 
> the odbc.ini and odbcinst.ini should be correct. But when I'm using 
> PHP-4.2.1 with unixODBC-support, I can connect to the local ressource 
> only, not to the remote-ressource, although it worked with isql. Do you 
> have any general ideas, why it doesn't work?
> 
> Are there known issues about the unixODBC-implementation in php? PHP 
> always says "unable to connect to server: database not found". But as I 
> told before, the odbc.ini settings are correct. It seems that php tries 
> to connect to a local server although in odbc.ini CommLinks-settings are 
> defined. Does maybe php don't receive the odbc.ini data correct? I 
> thought that it might be a permission problem, but I ran apache 1.3.26 
> (with php as module) with the same user to whom all the files and 
> databases belong and I got no positive result.

Hi,

I know its a little late, but I have only just been pointed to your 
posting, I would guess the error you are getting "database not found" is 
coming from the sybase driver, not the driver manager.

PHP doesn't get involved with the odbc.ini data, just the driver 
manager, but the sybase driver also needs to find its ini files, it 
doesn't get them from the driver manager ini file, but its own.

Can you first try using apache in single user mode, ie httpd -X, as the 
same user that can connect (say using isql) to the sybase driver, if one 
can connect, but the other not, I would then try

strace -o /tmp/stlog httpd -X

then try and connect and have a look (send me a copy if you want) of the 
log, it should show what files and drivers its trying to load.

---
Nick Gorham
Easysoft.


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




[PHP-DB] Re: Problem w/ mysql_pconnect

2002-06-24 Thread Tracker 1

php, is probably resolving localhost, to its' bound external ip,
or something other than 127.0.0.1 (in your hosts file, make
sure that localhost is in it.) or change the user's host in the
mysql.user table to localhost.localdomain, which will work too.

--
===
Michael J. Ryan  -  tracker1[*at*]theroughnecks.com
Roughneck BBS: http://www.theroughnecks.net  telnet://theroughnecks.net
===
Y!: aztracker1 - aim: azTracker1 - icq: 4935386 - msn: see email
One program for aim/icq/yahoo/msn/irc  -  http://www.trillian.cc/


"Paul D" <[EMAIL PROTECTED]> wrote in message
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
> Guys,
>
> I appreciate your input very much. This machine is a standalone unit.
> That's why I'm using "localhost". The user account has already been
> set-up in MySQL with the correct privileges, and I'm able to login at
> the console command prompt using "mysql -h localhost -u pauld -p
> my_pwd", with no problem at all. That's why I'm assuming that the
> problem lies somewhere else.
>
> Paul D wrote:
> > I'm using PHP 4.2.0 with MYSQL 3.23. When I try to use either the
> > mysql_connect or mysql_pconnect to access the database, I get the
> > following error message:
> >
> > Access denied for user: '[EMAIL PROTECTED]' (Using password: YES)
> >
> > I have tried different user names and nothing seems to work. If I use
> > the functions without any parameters, it'll work just fine, and when I
> > try access directly from the console, it'll work fine also. The problem
> > seems to lie with the function parameters, which is written as follows:
> >
> >  $db = mysql_pconnect("localhost", "pauld", "any_pwd") or
> > die($php_errormsg);
> >
> > Any suggestions would be very much appreciated.
> >
>



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




[PHP-DB] Re: Problem w/ mysql_pconnect

2002-06-23 Thread Paul D

Guys,

I appreciate your input very much. This machine is a standalone unit. 
That's why I'm using "localhost". The user account has already been 
set-up in MySQL with the correct privileges, and I'm able to login at 
the console command prompt using "mysql -h localhost -u pauld -p 
my_pwd", with no problem at all. That's why I'm assuming that the 
problem lies somewhere else.

Paul D wrote:
> I'm using PHP 4.2.0 with MYSQL 3.23. When I try to use either the 
> mysql_connect or mysql_pconnect to access the database, I get the 
> following error message:
> 
> Access denied for user: '[EMAIL PROTECTED]' (Using password: YES)
> 
> I have tried different user names and nothing seems to work. If I use 
> the functions without any parameters, it'll work just fine, and when I 
> try access directly from the console, it'll work fine also. The problem 
> seems to lie with the function parameters, which is written as follows:
> 
>  $db = mysql_pconnect("localhost", "pauld", "any_pwd") or
> die($php_errormsg);
> 
> Any suggestions would be very much appreciated.
> 


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




[PHP-DB] Re: Problem with JOIN

2002-05-23 Thread Benjamin Walling

I'm not sure I'm reading what you want correctly, but it sounds like you
really want an INNER JOIN instead of a LEFT JOIN.  INNER JOIN will only join
if the records in both tables exist and match on the join criteria.  Also,
why are you joining the user_websites table to itself?  Just use WHERE
user_websites.user_id = '3'.  Generally, you would join the other tables
based on fields in the main table, instead of on constants.

SELECT
w.website,
c.comment,
i.icq,
s.signature
FROM user_websites w
INNER JOIN user_comments c ON w.user_id = c.user_id
INNER JOIN user_icq i ON w.user_id = i.user_id
INNER JOIN user_signature s ON w.user_id = s.user_id
WHERE w.user_id = '3'

This will only return records that exist in all of the tables.  If there are
any records that are not essential, change them to a LEFT JOIN.  For
example, if you icq and signature were optional return values, you would
LEFT JOIN them instead of INNER JOIN, then only records that matched in
user_websites and user_comments would be returned, and they would include
anything that was found in user_icq or user_signature.



"Andy" <[EMAIL PROTECTED]> wrote in message
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
> Hi there,
>
> I do want to pull out some data of a user. I did normalize the tables, so
> there is a table for website, comment ...
>
> Now I would like to pull out the users website, comment.. but only if
there
> is one.
>
> Unfortunatelly my select stmt returns all 5 records of the website
> table:
>
> SELECT
> w.website,
> c.comment,
> i.icq,
> s.signature
> FROM
> user_websites
> LEFT JOIN user_comments AS c ON c.user_id = '3'
> LEFT JOIN user_icq AS i ON i.user_id = '3'
> LEFT JOIN user_signature AS s ON s.user_id = '3'
> LEFT JOIN user_websites AS w ON w.user_id = '3'
>
> Somehow my syntax must be wrong, but I can not find the error :-(
>
> Maybe one of you guys does know why.
>
> Thanx in advance,
>
> Andy
>
>



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




[PHP-DB] Re: Problem on Load Data into Specific Fields of a table?

2002-05-06 Thread David Robley

In article <[EMAIL PROTECTED]>, 
[EMAIL PROTECTED] says...
> Dear all
> 
> Two Question :
> 1.
> I know that the 'LOAD DATA' command loads a bulk of data into a table, but
> what happen if i only want to load the data into specifc fields on a table
> instead of whole table.
> 
> eg.
> Let say i had a file with 3 column of data, and i want to load these data
> into a 'ABC' table's field 3 to 5 and leave field 1 & 2 as it was!

The LOAD DATA comand can do this: from the mysql docs:

The following example loads all columns of the persondata table:
mysql> LOAD DATA INFILE 'persondata.txt' INTO TABLE persondata;
No eld list is specied, so LOAD DATA INFILE expects input rows to 
contain a eld for each
table column. The default FIELDS and LINES values are used.
If you wish to load only some of a table's columns, specify a eld list:
mysql> LOAD DATA INFILE 'persondata.txt'
INTO TABLE persondata (col1,col2,...);

Check the mysql docs for more info.
> 
> 2.
> I copied a file into server's root directory, and i was trying to load that
> file's data to table which i had failed using the following command in
> MYSQL:
> "LOAD DATA infile 'c:\hkd_rate.csv' into table hkd_deposit1 fields
> terminated by ',' "
> It said couldn't find the file!
> but if i put the file into the data directory of mysql, then it can find it!
> So what should i do if i want mysql will able to find that file from root
> directory?

Again, this is covered in the documentation.

-- 
David Robley
Temporary Kiwi!

Quod subigo farinam

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




[PHP-DB] Re: Problem

2002-04-22 Thread dengach

What I meant is there is I think the problem is with the mySQL privilege
system or rather the way your permissions are  setup I suggested you first
go through the part of the mySQL manual with the PRIVILEGE SYSTEM then once
you set up you permissions well run the sql queries from the mysql command.

"Thomas "Omega" Henning" <[EMAIL PROTECTED]> wrote in message
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
> Ok i have a problem big one. I'm using php 4.0.6 and mysql 3.23 both win.
> And i use PhpMyAdmin to fill my database but MySQL reject every query i
post
> to it any idea why?
>
> Thanks
>
> Thomas "omega" Henning
>
>
>



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




[PHP-DB] Re: Problem with the beginning variable

2002-04-03 Thread Hugh Bothwell


"Ron Allen" <[EMAIL PROTECTED]> wrote in message
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
> I have a problem with the inital load of my page
>
> When it loads it says that the variable is not defined. When I click on
> search after that it works fine.
>
> How do I get PHP to recognize a variable as a certain value without making
> it a static value?

if (!isset($myvar))
$myvar = "this is my default value";



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




RE: [PHP-DB] Re: Problem with buttons

2002-01-02 Thread Rick Emery

Those who are new to PHP, mySQL, or both, come to this list looking for
help.  Some posters are tentative about posting questions for fear of
looking ignorant, or even worse.  Responses, such as Mr Ferger's below, do
not help this situation.

If you have a suggestion for a poster, please make it without attaching
smarmy editorials.  Lets help each other...

Happy new year.

-Original Message-
From: Ian Ferger [mailto:[EMAIL PROTECTED]]
Sent: Monday, December 31, 2001 3:47 PM
To: [EMAIL PROTECTED]
Subject: [PHP-DB] Re: Problem with buttons


if you look closely at your code (instead of posting yet another silly
message on this board) you'll notice that the first has an onclink
event..i am not presently aware of any such event.
to all you newbies out there: look over your code, check php.net, check the
comments sections, if ALL else fails, THEN post a message.


"Markus|Lervik" <[EMAIL PROTECTED]> wrote in message
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
> Hello everyone!
>
> Does anyone know what the problem might be with the following little
> php-snippet?
>
> print("  VALUE=\"Previous page\"
> onclink=\"parent.location='index.php?nav=true&go=prev';\">");
>
> print("  page\"
onclick=\"parent.location='index.php?nav=true&go=next';\">");
>
>
> The next button works perfectly, but for some strange reason nothing
happens
> when one hits the previous button.
> *sigh* I don't want to be coding today.. I want to be at home listening to
> the BBC 13 CD Lord of the Rings dramatization. *grin*
>
> Cheers,
> Markus



-- 
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]

-- 
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




[PHP-DB] Re: Problem with buttons

2001-12-31 Thread Ian Ferger

if you look closely at your code (instead of posting yet another silly
message on this board) you'll notice that the first has an onclink
event..i am not presently aware of any such event.
to all you newbies out there: look over your code, check php.net, check the
comments sections, if ALL else fails, THEN post a message.


"Markus|Lervik" <[EMAIL PROTECTED]> wrote in message
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
> Hello everyone!
>
> Does anyone know what the problem might be with the following little
> php-snippet?
>
> print("  VALUE=\"Previous page\"
> onclink=\"parent.location='index.php?nav=true&go=prev';\">");
>
> print("  page\"
onclick=\"parent.location='index.php?nav=true&go=next';\">");
>
>
> The next button works perfectly, but for some strange reason nothing
happens
> when one hits the previous button.
> *sigh* I don't want to be coding today.. I want to be at home listening to
> the BBC 13 CD Lord of the Rings dramatization. *grin*
>
> Cheers,
> Markus



-- 
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




[PHP-DB] Re: Problem with PHP4 and dba_open

2001-12-20 Thread Juffe Åberg

> If you are using PostgreSQL module, do not use PostgreSQL for now.
> I'll work on conflict issue later, but I don't think it will be
> fixed any time soon

No, I don't use PostgreSQL module.. so what's wrong? Sometimes, when I
reboot machine, it works for a while..?



-- 
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




[PHP-DB] Re: Problem with PHP4 and dba_open

2001-12-19 Thread Yasuo Ohgaki

Juffe ÅBerg wrote:

> When I try to open a file, ex. using command:
> $db = dba_open("newfile", "c", "db3");
> 
> and run script from the command line, it only says:
> "driver initialization failed in test.php line 50."
> 
> why? i have extension php_db and php_dba (and some others) included in as
> modules. so.. what's wrong?
> 
> - Juffe
> 


If you are using PostgreSQL module, do not use PostgreSQL for now.
I'll work on conflict issue later, but I don't think it will be
fixed any time soon

-- 
Yasuo Ohgaki


-- 
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




[PHP-DB] Re: Problem with my Car DB

2001-11-21 Thread Fred

just add "LIMIT N,R" to your SELECT statement where N is the row you want to
start with and R is the number of rows you want to fetch.

The first row is 0 so if you want to fetch 10 cars per page make R 10 and
make N a variable.  Pass 0 to N on the first pass, then put links on your
page for NEXT where N=N+10

Fred

Lynn Geise <[EMAIL PROTECTED]> wrote in message
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
> Can someone give me the code to make the db display 10 cars per page then
> make another page with the links below the car for the next page youc na
see
> the car db here so far
> http://www.games-are-forever.com/phpadmin/cardisplay.php
>
>



-- 
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




[PHP-DB] Re: Problem with special characters

2001-11-09 Thread Steve Brett

I have code at work that encodes and decodes escape chars when inserted into
mysql or displayed as html.

Can't remember the syntax exactly but I did use htmlentities and then
array_flip on the way out. There is an example in the php help file.

Found it. I love it when PHP can do stuff like this :-)

  PHP Manual
  Prev  Next




get_html_translation_table
(PHP 4 >= 4.0b4)

get_html_translation_table --  Returns the translation table used by
htmlspecialchars() and htmlentities()
Description

string get_html_translation_table (int table [, int quote_style])


get_html_translation_table() will return the translation table that is used
internally for htmlspecialchars() and htmlentities(). There are two new
defines (HTML_ENTITIES, HTML_SPECIALCHARS) that allow you to specify the
table you want. And as in the htmlspecialchars() and htmlentities()
functions you can optionally specify the quote_style you are working with.
The default is ENT_COMPAT mode. See the description of these modes in
htmlspecialchars(). Example 1. Translation Table Example

$trans = get_html_translation_table (HTML_ENTITIES);
$str = "Hallo &  & Krämer";
$encoded = strtr ($str, $trans);



The $encoded variable will now contain: "Hallo &  &
Krämer".

The cool thing is using array_flip() to change the direction of the
translation.


$trans = array_flip ($trans);
$original = strtr ($str, $trans);




The content of $original would be: "Hallo &  & Krämer".
  Note: This function was added in PHP 4.0.


See also: htmlspecialchars(), htmlentities(), strtr(), and array_flip().




  Prev Home Next
  explode Up get_meta_tags


If you're still needing an example mail me at [EMAIL PROTECTED] and
I'll send you code.

Steve

"Don" <[EMAIL PROTECTED]> wrote in message
news:01bc01c16870$6709b5c0$[EMAIL PROTECTED]...
Hi,

I have a mysql database that contains various data.  I am using PHP to pull
out the data and display it within a HTML form.  I am having trouble with
certain data that contains escaped characters.

Example: field contains --> mr "John Smith"

My PHP code is:
echo "";

The result displayed is --> mr

What happened to "John Smith" ???

I have tried the functions stripslashes and addslashes but still no luck.

Can anyone help?

Thanks,
Don




-- 
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




[PHP-DB] Re: Problem with a form

2001-10-19 Thread Michael J. Eisner

Hi,

disregard this post - i found the error - a little mistyping :-(

Michael


"Michael J. Eisner" <[EMAIL PROTECTED]> schrieb im Newsbeitrag
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
> Hi,
>
> I have a form with two dropdown fields. When ever one of them is changed,
a
> javascript function is called that reloads the whole PHP-Page.
>
> The first dropdown has values in the form like '19.10.2001' or
'25.10.2001'
> the second one only one charakter like 'V', 'M' or 'F'.
>
> When I change the form with the date-values, everything is OK, I got the
> parameters '&DateSet=[selected value]' in the URL.
> But when ever I change the second field, the URL reads
> '...&DateSet=%25d.10.2001'
> The value of the second field is always correct in the URL.
>
> Where the heck is the error
>
> Michael
>
>
>
>



-- 
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




RE: [PHP-DB] Re: Problem with odbc_next_result

2001-09-12 Thread Andrew Hill

Daniel,

What driver are you using?
I'll check your code against another one for comparison's sake, and do some
property queries.

Actually, if you want to query the driver for it's features yourself, you
can download a trial of ODBCScan from our site.

Best regards,
Andrew Hill
Director of Technology Evangelism
OpenLink Software  http://www.openlinksw.com
Universal Data Access & Data Integration Technology Providers

> -Original Message-
> From: Daniel Bennett [mailto:[EMAIL PROTECTED]]
> Sent: Wednesday, September 12, 2001 11:47 AM
> To: [EMAIL PROTECTED]
> Subject: [PHP-DB] Re: Problem with odbc_next_result
>
>
> Michael - could seem to reply to your email address... here's the code
>
> where $res is a valid result_id (I've tested it without the
> odbc_next_result):
>
> do {
> while ($odbc_get_into($res,$row)) {
> print "$row[0]";
> }
> } while ($odbc_next_result($res));
>
> Seems to crash on the first call to odbc_get_into after odbc_next_result
>
>
>
> "Daniel Bennett" <[EMAIL PROTECTED]> wrote in message
> [EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
> > Hi,
> >
> > Anyone had problems with odbc_next_result on WinNT?
> >
> > I can call the function, but as soon as I try to get a row from the next
> > result set, php crashes.
> >
> > Any ideas?
> >
> > Daniel Bennett
> > [EMAIL PROTECTED]
> >
> >
>
>
>
> --
> PHP Database Mailing List (http://www.php.net/)
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
> To contact the list administrators, e-mail: [EMAIL PROTECTED]
>
>


-- 
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




[PHP-DB] Re: Problem with odbc_next_result

2001-09-12 Thread Daniel Bennett


PS - Ignore the $'s in front of odbc - typo!

"Daniel Bennett" <[EMAIL PROTECTED]> wrote in message
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
> Michael - could seem to reply to your email address... here's the code
>
> where $res is a valid result_id (I've tested it without the
> odbc_next_result):
>
> do {
> while ($odbc_get_into($res,$row)) {
> print "$row[0]";
> }
> } while ($odbc_next_result($res));
>
> Seems to crash on the first call to odbc_get_into after odbc_next_result
>
>
>
> "Daniel Bennett" <[EMAIL PROTECTED]> wrote in message
> [EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
> > Hi,
> >
> > Anyone had problems with odbc_next_result on WinNT?
> >
> > I can call the function, but as soon as I try to get a row from the next
> > result set, php crashes.
> >
> > Any ideas?
> >
> > Daniel Bennett
> > [EMAIL PROTECTED]
> >
> >
>
>



-- 
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




[PHP-DB] Re: Problem with odbc_next_result

2001-09-12 Thread Daniel Bennett

Michael - could seem to reply to your email address... here's the code

where $res is a valid result_id (I've tested it without the
odbc_next_result):

do {
while ($odbc_get_into($res,$row)) {
print "$row[0]";
}
} while ($odbc_next_result($res));

Seems to crash on the first call to odbc_get_into after odbc_next_result



"Daniel Bennett" <[EMAIL PROTECTED]> wrote in message
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
> Hi,
>
> Anyone had problems with odbc_next_result on WinNT?
>
> I can call the function, but as soon as I try to get a row from the next
> result set, php crashes.
>
> Any ideas?
>
> Daniel Bennett
> [EMAIL PROTECTED]
>
>



-- 
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




[PHP-DB] Re: Problem compiling pgsql and php (Semi OT)

2001-07-31 Thread Steve Brett

ok .

i've had this problem and fixed it thus:

--with-pgsql=/path/to/unzipped/files

e.g. --with-pgsql=/usr/src/postgresql7.1.1/

and it works, and has done for the last seven months.

rasmus bit my head off though when i suggested it though so sh.

Steve

"Matt Williams" <[EMAIL PROTECTED]> wrote in message
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
>
> -BEGIN PGP SIGNED MESSAGE-
> Hash: SHA1
>
> Hi all
>
> I'm trying to add support for pgsql to my current setup.
> Everything (php 4.0.4, pgsql 7.1.1, apache 1.3.19) is compiled from
> source.
> Postgres is working fine on its own.
>
> Postgres is installed to /usr/local/pgsql
> I've tried compiling with
> - --with-pgsql
> - --with-pgsql=/usr/local/pgsql
>
> but each time I get the same error when I run make. The error is
>
> php_pgsql.h:32 postgres.h No such file or directory
> make[3]: *** [pgsql.lo]Error 1
> make[3]: Leaving current directory
> '/usr/local/src/php-4.0.4pl1/ext/pgsql'
>
>
> I seem to remember when I install postgres onto nother machine using
> RPM I had to add pgsql_devel but I don't know to do this compiling
> postgres from source. Trawling through the manual and archives has
> sofar proved fruitless.
>
> Any help will be gratefully appreciated
>
> TIA
> M@
>
> -BEGIN PGP SIGNATURE-
> Version: PGPfreeware 7.0.3 for non-commercial use 
>
> iQA/AwUBO2bJ/qW0/zC+QxWwEQIkXACfXt7RAVI1JMkt5I3K01b+pur3cLkAoLZt
> CacpMr4hD8IO+UpXwEYNamSf
> =VZof
> -END PGP SIGNATURE-
>



-- 
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




[PHP-DB] Re: problem with regular expression

2001-07-16 Thread CC Zona

In article <001601c10dc9$e4513780$[EMAIL PROTECTED]>,
 [EMAIL PROTECTED] (Jennifer Arcino Demeterio) wrote:

> i have a script to identify if the input is a combination of letters and 
> numbers 
>  
> if (eregi("[a-zA-Z0-9][0-9]+[a-zA-Z][0-9a-zA-Z]",$fieldvalue)) 
> print "alphanumeric"
> } else {
> not an alphanumeric
> } 
> 
> my problem is, when the string ends with a number, for example hello123, it 
> says "not an alpanumeric" ... it works fine when the number is placed before 
> the letters or in between letters ... why is that? 


Your regex matches a pattern of:

-one alphanumeric
-followed by one or more digits
-followed by one letter
-followed by one alphanumeric

The string "hello123" is failing because it does not match the specified 
pattern.  (If "123hello" or "he123llo" really is passing as you describe, 
re-check your code because that should not be possible given the above 
regex.) 

If you want to know if the entire string consists (from beginning to end) 
of any combination of alphanumeric characters, try:

"^[[:alnum:]]+$"

-- 
CC

-- 
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




RE: [PHP-DB] Re: problem running stored MsSQL procedure

2001-07-11 Thread Michael Yevdokimov

So what is actually the problem with running sp in mssql?

Mike

-Original Message-
From: Carpe Diem Support [mailto:[EMAIL PROTECTED]]
Sent: Wednesday, July 11, 2001 3:32 PM
To: Hugh Bothwell; [EMAIL PROTECTED]; [EMAIL PROTECTED]
Subject: RE: [PHP-DB] Re: problem running stored MsSQL procedure


> > > -Original Message-
> > > From: Hugh Bothwell [mailto:[EMAIL PROTECTED]]
> > > Sent: 11 July 2001 14:21
> > > To: [EMAIL PROTECTED]; [EMAIL PROTECTED]
> > > Subject: [PHP-DB] Re: problem running stored MsSQL procedure
> > >
> > >
> > > (ahem)  MySQL does not support stored procedures.  If you really
> > > need them,
> > > look at PostgreSQL.
> >
> > The question was actually mssql not mysql :))
>
> D'oh!  Going blind in my old age, I guess...


heheheh :) Easy mistake to make :)

--
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]



-- 
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




[PHP-DB] Re: problem with form

2001-07-10 Thread Hugh Bothwell

Try setting form.action and using form.submit() to send it ('edit.php' is
not valid javascript).

Here:








Note that this includes a fall-back: if JavaScript is not supported, the
form will be submitted by either button.

"Jennifer Arcino Demeterio" <[EMAIL PROTECTED]> wrote in message
000a01c1092d$0c3baba0$[EMAIL PROTECTED]">news:000a01c1092d$0c3baba0$[EMAIL PROTECTED]...
> hello,
>
> hope anyone has an idea on how to fix this...
>
> 
>  OnClick="submit.php" class="button">
>  class="button">
> 
>
> even i click on the edit button, it will still go to submit.php page, why
is
> that?
>
> thanks



-- 
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




[PHP-DB] Re: problem with form

2001-07-10 Thread Johannes Janson

Hi,

> hope anyone has an idea on how to fix this...
>
> 
>  OnClick="submit.php" class="button">
>  class="button">
> 

you could give the form one action and then check on the following page
wether $Submit or $Edit is set.

form.php

...


doit.php
http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]