php-windows Digest 6 Jun 2003 11:48:57 -0000 Issue 1764
Topics (messages 20211 through 20220):
PHP, ODBC, Unable to Connect
20211 by: Joseph McDonald
20218 by: Luis Ferro
Re: Deleting users from htpasswd
20212 by: Guru P Chaturvedi
20217 by: Cristian MARIN
install PHP 431 on Windows 2003 server
20213 by: s
Variable Problems
20214 by: Dylan Williams
doing $mc=new myclass(); or $mc= &new myclass(); ?
20215 by: Peter Misun
20216 by: DvDmanDT
20219 by: Sven Schnitzke
20220 by: Peter Misun
Administrivia:
To subscribe to the digest, e-mail:
[EMAIL PROTECTED]
To unsubscribe from the digest, e-mail:
[EMAIL PROTECTED]
To post to the list, e-mail:
[EMAIL PROTECTED]
----------------------------------------------------------------------
--- Begin Message ---
Here is the code (acct # blurred for obvious reason):
##begin paste##
<?php
$connect = odbc_connect("testcusa","","");
$query = "SELECT ACCT.DIVRATE, ACCT.BEG_DATE, ACCT.END_MATR, ACCT.CDPY_COD,
ACCT.CDPMTRM, ACCT.CDFLTRM, ACCT.OCERTBAL, NAME.NAME, NAME.SSN,
ACCT.\"ACCT#\", ACCT.SFX FROM ACCT ACCT, NAME NAME WHERE ACCT.\"ACCT#_JOIN\"
= NAME.\"ACCT#_JOIN\" AND ((ACCT.\"ACCT#\"=\'******\') AND (ACCT.SFX Like
\'M\'))";
$result = odbc_exec($connect, $query);
odbc_result_all($result);
?>
##end paste##
Here is the result:
##being paste##
Warning: SQL error: [Simba Technologies Inc.][SimbaEngine C/S ODBC
Driver][SimbaClient][SimbaClient LNA]Client RPC error. Error = (103) Error
sending message. Trap = (111) Error closing connection. Value = (533)
Endpoint in incorrect state. State = CLOSE_STATE. , SQL state 08S01 in
SQLConnect in C:\Program Files\Apache Group\Apache2\htdocs\CD\query.inc on
line 5
Warning: odbc_exec(): supplied argument is not a valid ODBC-Link resource in
C:\Program Files\Apache Group\Apache2\htdocs\CD\query.inc on line 5
Warning: odbc_result_all(): supplied argument is not a valid ODBC result
resource in C:\Program Files\Apache Group\Apache2\htdocs\CD\query.inc on
line 6
##end paste##
The server is a custom Simba database wrote to access cfam databases on a
RS/6000 box. I can pull info from this database using ODBC Explorer, MSQry
tool, and several others, but PHP just will not give me back any data. I
keep getting this error message. I have searched online and with no evail.
If anyone can help me with this, I would greatly appreciate it. I am doing
my best to learn PHP & several database systems but this has put a bump in
my road. PHP's ODBC does work, I've connected using openlink and progress
server on the same RS/6000 box to a diff database.
Thanks in advance
Joe
I
--- End Message ---
--- Begin Message ---
I just got lost in the query string...
Try to "echo $query;" and then see if there is any typo in the query
itself... i work that way with php/mysql and most of the cases where i
find such an error is some sort of typo in the query...
Cheers...
Luis Ferro
Joseph McDonald wrote:
Here is the code (acct # blurred for obvious reason):
##begin paste##
<?php
$connect = odbc_connect("testcusa","","");
$query = "SELECT ACCT.DIVRATE, ACCT.BEG_DATE, ACCT.END_MATR, ACCT.CDPY_COD,
ACCT.CDPMTRM, ACCT.CDFLTRM, ACCT.OCERTBAL, NAME.NAME, NAME.SSN,
ACCT.\"ACCT#\", ACCT.SFX FROM ACCT ACCT, NAME NAME WHERE ACCT.\"ACCT#_JOIN\"
= NAME.\"ACCT#_JOIN\" AND ((ACCT.\"ACCT#\"=\'******\') AND (ACCT.SFX Like
\'M\'))";
$result = odbc_exec($connect, $query);
odbc_result_all($result);
?>
##end paste##
Here is the result:
##being paste##
Warning: SQL error: [Simba Technologies Inc.][SimbaEngine C/S ODBC
Driver][SimbaClient][SimbaClient LNA]Client RPC error. Error = (103) Error
sending message. Trap = (111) Error closing connection. Value = (533)
Endpoint in incorrect state. State = CLOSE_STATE. , SQL state 08S01 in
SQLConnect in C:\Program Files\Apache Group\Apache2\htdocs\CD\query.inc on
line 5
Warning: odbc_exec(): supplied argument is not a valid ODBC-Link resource in
C:\Program Files\Apache Group\Apache2\htdocs\CD\query.inc on line 5
Warning: odbc_result_all(): supplied argument is not a valid ODBC result
resource in C:\Program Files\Apache Group\Apache2\htdocs\CD\query.inc on
line 6
##end paste##
The server is a custom Simba database wrote to access cfam databases on a
RS/6000 box. I can pull info from this database using ODBC Explorer, MSQry
tool, and several others, but PHP just will not give me back any data. I
keep getting this error message. I have searched online and with no evail.
If anyone can help me with this, I would greatly appreciate it. I am doing
my best to learn PHP & several database systems but this has put a bump in
my road. PHP's ODBC does work, I've connected using openlink and progress
server on the same RS/6000 box to a diff database.
Thanks in advance
Joe
I
--- End Message ---
--- Begin Message ---
Hi Cristian,
Well that's right... i wanna do it thru PHP Scrip... but dunno what exactly
i should use... any clues...?
"Cristian Marin" <[EMAIL PROTECTED]> wrote in message
news:[EMAIL PROTECTED]
Remove the line of the user from the .htpasswd. You can do it manually or a
php script can do it for you.
--
-------------------------------------------------
Cristian MARIN
InterAKT Online (www.interakt.ro)
+4021 411 2610
[EMAIL PROTECTED]
"Guru P Chaturvedi" <[EMAIL PROTECTED]> wrote in message
news:[EMAIL PROTECTED]
Hi,
i am storing all users for accessing apache resources in a file called
my.users i am able to add/modify users and passwords using the htpasswd
utility. But not able to remove a particular user... are there anyways of
doing it? can u please help...
with Warm Regards,
Guru.
---------------------------------------
Phone: (+91)9845290270
URL: www.gangarasa.com
Yahoo IM: guru4vedi
MSN: [EMAIL PROTECTED]
---------------------------------------
--- End Message ---
--- Begin Message ---
$user = "bubu";
$file_ht = fopen("path_to_the_htaccess","r+");
if ($file_ht){
$content_file = fread($file_ht, filesize("path_to_the_htaccess"));
fclose($file_ht);
$content_file = preg_replace("/".$user.".*\n/","",$content_file);
$file_ht=fopen("path_to_the_htaccess","w+");
if ($file_ht){
fwrite($file_ht,$content_file);
fclose($file_ht);
}else{
echo "Failed open for writing";
}
}else{
echo "failed open for reading";
}
You have to replace the user with the $user ( I don't know how do you take the user)
and the path_to_the_htaccess
Hope it helps.
--
-------------------------------------------------
Cristian MARIN
InterAKT Online (www.interakt.ro)
+4021 411 2610
[EMAIL PROTECTED]
"Guru P Chaturvedi" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED]
Hi Cristian,
Well that's right... i wanna do it thru PHP Scrip... but dunno what exactly
i should use... any clues...?
"Cristian Marin" <[EMAIL PROTECTED]> wrote in message
news:[EMAIL PROTECTED]
Remove the line of the user from the .htpasswd. You can do it manually or a
php script can do it for you.
--
-------------------------------------------------
Cristian MARIN
InterAKT Online (www.interakt.ro)
+4021 411 2610
[EMAIL PROTECTED]
"Guru P Chaturvedi" <[EMAIL PROTECTED]> wrote in message
news:[EMAIL PROTECTED]
Hi,
i am storing all users for accessing apache resources in a file called
my.users i am able to add/modify users and passwords using the htpasswd
utility. But not able to remove a particular user... are there anyways of
doing it? can u please help...
with Warm Regards,
Guru.
---------------------------------------
Phone: (+91)9845290270
URL: www.gangarasa.com
Yahoo IM: guru4vedi
MSN: [EMAIL PROTECTED]
---------------------------------------
--- End Message ---
--- Begin Message ---
I can't install PHP 4.3.1 on a Windows 2003 server.
Return message for a missing OCX file.
Simos Anagnostakis
Dept. of Primary Education
University of Crete
Campus Rethymno 74100
tel +302831077623 fax 77596
--- End Message ---
--- Begin Message ---
Hi all,
I'm having trouble using variables.
If I create a PHP file and define the variables within it (e.g. $name =
"Bob";) and then ask the same file to ouput the variable as part of an echo
command (e.g. echo( "Hello, $name"); ), it works fine.
The problem comes when I try to link to a PHP file from an HTML file (e.g.
<A HREF="name.php?name=Bob"> I am Bob </A>. Instead of displaying the
sentence as defined in the PHP file (e.g. echo( "Hello, $name"); ), I get
the following error message:
Notice: Undefined variable: name in e:\xxx\name.php on line 43
Does anyone know what the problem might be? I've tried writing the code in
a number of different ways but with the same result. Could it be that my
PHP or IIS server settings are not quite right?
Many thanks for any help!
Dylan.
--
Dylan J. Williams
Silent Films & Plug Music (HK) Limited
GPO Box 8315,
Central, Hong Kong SAR,
China.
Ph: +852 9641 2246 Fx; +852 2809 2550
www.silent-films.org
--- End Message ---
--- Begin Message ---
need help:
what do you suggest to use:
$mc = new myclass();
or
$mc = &new myclass();
because in any tutorial I can see the first form, but on page "what references do" in
PHP manual I found out the second form
so?
5o
--- End Message ---
--- Begin Message ---
I do believe you want the first version...
"Peter Misun" <[EMAIL PROTECTED]> skrev i meddelandet
news:[EMAIL PROTECTED]
>
> need help:
> what do you suggest to use:
>
> $mc = new myclass();
> or
> $mc = &new myclass();
>
> because in any tutorial I can see the first form, but on page "what
references do" in PHP manual I found out the second form
>
> so?
>
> 5o
>
>
--- End Message ---
--- Begin Message ---
Hi Peter,
with new() logically this doesn't make any difference because
PHP is using the reference concept anyway.
$b = &anything
tells PHP to get hold of final effective "anything" and if it evaluates
to something referenceable: _not_ build a copy of it and then set
variable "b" to reference it.
This is conceptual. If you want to know if &new() is 'cheaper'
than new() you might want to ask the developers list or take
a look at execution time for 10000 [&]new()s or so.
Thus
$a = 1; $b = $a; $a = 2; echo $b; // will show 1
because the value of $a is copied to form a new value
and then variable "b" is set to reference it.
//Whereas
$a = 1; $b = &$a; $a = 2; echo $b; // will show 2
because $a and $b reference the identical value instance.
$a = &any_constant; // is forbidden
because constants can not be referenced at all. You have
to ask PHP to do
$a = any_constant;
so it can form a value of the constant and then set $a to
reference it.
Hope this helps
--
Sven
> -----Ursprüngliche Nachricht-----
> Von: Peter Misun [SMTP:[EMAIL PROTECTED]
> Gesendet am: Freitag, 6. Juni 2003 11:23
> An: [EMAIL PROTECTED]
> Betreff: [PHP-WIN] doing $mc=new myclass(); or $mc= &new myclass(); ?
>
> << Datei: ATT00004.g95; charset = iso-8859-2 >>
--- End Message ---
--- Begin Message ---
why?
there is written, that not using & sign will assign only copy ov object created - that
means, you have one object 2 times in memory (in the first case)
5o
Dvdmandt wrote:
> I do believe you want the first version...
> "Peter Misun" <[EMAIL PROTECTED]> skrev i meddelandet
> news:[EMAIL PROTECTED]
> >
> > need help:
> > what do you suggest to use:
> >
> > $mc = new myclass();
> > or
> > $mc = &new myclass();
> >
> > because in any tutorial I can see the first form, but on page "what
> references do" in PHP manual I found out the second form
> >
> > so?
> >
> > 5o
> >
> >
--
Mgr. Peter Misun
MicroStep-MIS, Ilkovicova 3, 841 04 Bratislava, Slovakia
tel: +421/ 2/ 602 00 127, 111, fax: +421/ 2/ 602 00 180
--- End Message ---