php-windows Digest 11 Dec 2002 11:50:29 -0000 Issue 1481

Topics (messages 17370 through 17379):

Re: Starnge parse problem
        17370 by: Jim
        17372 by: Svensson, B.A.T. (HKG)

Problem of PHP building with VC60
        17371 by: Le Thanh Ha

Re: [PHP-DB] mssql_next_result and stored procedures
        17373 by: Svensson, B.A.T. (HKG)
        17374 by: Svensson, B.A.T. (HKG)
        17375 by: Gene Dymarskiy

Re: Php & IIS 3 +Win NT
        17376 by: mst

unable to connect to server (MSSQL)
        17377 by: Charles P. Killmer
        17378 by: Frank M. Kromann

Re: can't connect localhost
        17379 by: toby z

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 ---
George,
   You were missing an ending curly brace. Check out the last few lines and see where it was missing. When you get odd errors like this, start counting brackets and parens and braces to make sure they add up to an even amount. In this case, you had an odd number of braces so I just matched up the pairs and found that you never closed the FOR loop. BTW, you also have some <BR> statements that are totally outside of any strings that are going to cause errors and your function as written will not work. Once you remove the <BR>'s you are going to find that you are going to need to work on the logic as it still won't due what you are expecting but at least you can run it and go from there.
 
Jim
 
-------Original Message-------
 
Date: Tuesday, December 10, 2002 01:21:01
Subject: [PHP-WIN] Starnge parse problem
 

Hi guys,

I am starting to build a calendar. I know that there are resources out there
but I want to learn, so I'm starting from scratch.

I've got my thinking this far and I've hit an unexpected snag.

When I call the page containing the following script:

<?php

$max = date("t");
$dateM = date("n");
$dateY = date("Y");
$dateNow = date("j");

echo "<Table width=70% border=1>";

for ($x = 1; $x < = $max; $x++) < BR> < BR> {
  $dayName = date ("l", mktime(0,0,0,$dateM,$x,$dateY));
  $dayNum = date ("w", mktime(0,0,0,$dateM,$x,$dateY));
  $d1 = 0;

  while ( $dayNum > $d1 )
  {
    if ( $d1 == 0 )
    {
      echo "<tr><td bgcolor=gray>&nbsp;</td>";
    }
    else
    {
      echo "<td bgcolor=cornflower>&nbsp;</td>";
    }
  }

  if ( $dateNow == $x && $dayNum == 0 ) < BR >   < BR >   {
    echo "</tr><tr><td bgcolor=yellow>".$x."</td>";
  }
  else
  {
     if ( $dateNow == $x && $dayNum == 6)< BR >       < BR >      { 
         echo "<td bgcolor=yellow>".$x."</td>";
         if ( $dayNum == 0 ) 
         {
           echo "</tr><tr><td bgcolor=gray>".$x."</td>";
         }  
         else
         {
           echo "<td bgcolor=cornflower>".$x."</td>";
          }
     }< BR >   }

}   // THIS IS THE ONE THAT WAS MISSING !!!!!!
  echo "</tr>";
  echo "</Table>";
?>


I get this error:

"Parse error: parse error, unexpected $ in c:\inetpub\wwwroot\Month2.php on
line 48"

Now can anyone suggest where I've gone wrong?

Cheers

George in Oxford

===

George Pitcher
HERON Technical Manager
Ingenta plc
23-38 Hythe Bridge Street, Oxford, OX1 2ET
T +44 (0)1865 799137 direct
T +44 (0)1865 799000 switchboard
F +44 (0)1865 799134
E [EMAIL PROTECTED]

www.ingenta.com
Ingenta: Empowering the exchange of academic and professional content
online.


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

.

____________________________________________________
  IncrediMail - Email has finally evolved - Click Here
--- End Message ---
--- Begin Message ---
> -----Original Message-----
> From: George Pitcher [mailto:[EMAIL PROTECTED]]
> Sent: Tuesday, December 10, 2002 10:15 AM
> To: [EMAIL PROTECTED]
> Subject: [PHP-WIN] Starnge parse problem

>Parse error: parse error, unexpected $ in c:\inetpub\wwwroot\Month2.php on ine 48"
> Now can anyone suggest where I've gone wrong?


This for-loop misses a closing brace:

> for ($x = 1; $x <= $max; $x++) {
--- End Message ---
--- Begin Message ---
Hi guys
I'v downloaded the lastest version of PHP source code, and tried to compile with MS 
Visual C++. Everything went to be in order until the Compiler reached the file named 
"apra/inet.h", and didn't realize where to find it out. I have no idea of fixing the 
problem.
Please help me
Thanks
--- End Message ---
--- Begin Message ---
> It appears that mssql_next_result does not work with stored procedures.
> 
> I was able to use the function with PHP side queries.
> However when a stored proc returns multiple result sets I am able 
> to grab only first set and get the following warning:
> 
> Warning: mssql_execute: multiple recordsets from a stored procedure
> not supported yet! (Skipping...) 
> 
> I run PHP 4.2.0
> 
> Is there a work around for this  limitation?

Put everything in a temporary table and return only that one.

Normally I only return data in one format (that is a one column table
wit a varchar typically 2000 byte or so.) But if you need to return
row types in each result set, then you need to specify a protocol to
handle this. This is several Q&D way to handle it:

1) Join all result sets to a concatenated table; plus an additional
column (flag) that specify which "result set a particularly tupple
belongs to.

For example if you wish to return table A(a1, a2) and table B(b1, b2)
create table AB(flag,a1,a2,b1,b2)

And return typically:

1 data data null null
1 data data null null
1 data data null null
2 null null data data
2 null null data data
2 null null data data
2 null null data data


2) Same as 1) except instead skipp the flag but read data until you encounter
a null value, then you know you deal with a new result set (this requires
that you return the result sets in a predetermined order.

In case your insert order is of importance you will also need to
add an auto incremental filed and sort by this one when returning
the result set.

> Perhaps it was solved in the later releases of PHP?

ODBC should support multiple result set. My Ignorant remark:
Does it work by using an ODBC connection with PHP?
--- End Message ---
--- Begin Message ---
Errata:

> wit a varchar typically 2000 byte or so.) But if you need to return
> row types in each result set, then you need to specify a protocol to

"But if you need to return different row types in each result set"
--- End Message ---
--- Begin Message ---
Looks like a workable work-around. Thank you!

RE: ODBC. I did not try it. I suspect that native API, however limited, should be more 
robust compared to generic ODBC approach. 

best regards

gd

-----Original Message-----
From: Svensson, B.A.T. (HKG) [mailto:[EMAIL PROTECTED]]
Sent: Tuesday, December 10, 2002 6:52 AM
To: Gene Dymarskiy; [EMAIL PROTECTED]
Subject: RE: [PHP-WIN] [PHP-DB] mssql_next_result and stored procedures


> It appears that mssql_next_result does not work with stored procedures.
> 
> I was able to use the function with PHP side queries.
> However when a stored proc returns multiple result sets I am able 
> to grab only first set and get the following warning:
> 
> Warning: mssql_execute: multiple recordsets from a stored procedure
> not supported yet! (Skipping...) 
> 
> I run PHP 4.2.0
> 
> Is there a work around for this  limitation?

Put everything in a temporary table and return only that one.

Normally I only return data in one format (that is a one column table
wit a varchar typically 2000 byte or so.) But if you need to return
row types in each result set, then you need to specify a protocol to
handle this. This is several Q&D way to handle it:

1) Join all result sets to a concatenated table; plus an additional
column (flag) that specify which "result set a particularly tupple
belongs to.

For example if you wish to return table A(a1, a2) and table B(b1, b2)
create table AB(flag,a1,a2,b1,b2)

And return typically:

1 data data null null
1 data data null null
1 data data null null
2 null null data data
2 null null data data
2 null null data data
2 null null data data


2) Same as 1) except instead skipp the flag but read data until you encounter
a null value, then you know you deal with a new result set (this requires
that you return the result sets in a predetermined order.

In case your insert order is of importance you will also need to
add an auto incremental filed and sort by this one when returning
the result set.

> Perhaps it was solved in the later releases of PHP?

ODBC should support multiple result set. My Ignorant remark:
Does it work by using an ODBC connection with PHP?
--- End Message ---
--- Begin Message ---
I try install on NT (back office 4.5). It do not work. I changed my OS to
win2000. It was solution.
You try use apache.

mst
Uzytkownik "Veselina Stoyanova" <[EMAIL PROTECTED]> napisal w wiadomosci
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
> Hello, everyone!
> Does anyone have some experience with installing php on Win NT 4, running
> IIS 3? I've have tried several times using either Windows installer and
CGI
> binary zip, but it doesn't work.
> Windows installer works properly and displays a message saying the
> installation is ok, but it doesn't work.
> The same installation package works on Win 2000 without any problems.
> Thanks in advance.
> Veselina
>


--- End Message ---
--- Begin Message ---
PHP Warning:  MS SQL error:  Unable to connect: SQL Server is
unavailable or does not exist. (severity 9) in pathtofile\test.php4 on
line 5
PHP Warning:  MS SQL:  Unable to connect to server:  192.168.168.168 in
pathtofile\test.php4 on line 5
 
 
Why would I get these errors when I access a php file with Netscape 7
and not when I access the same file with IE 6.  I can switch back and
forth as fast as I can and every request from IE works and every request
from Netscape fails.  So it isn't a timing issue where the SQL Server is
going away for a second.
 
If I continue the file and try to run queries to test the connection,
the queries verify the errors.  IE They don't run when requested by
Netscape 7 and they do when requested by IE 6
 
This is my setup
 
IIS 5.0
 -Virtual Site
 -Directory security: basic
  -Anonymous Access: Disallowed
 -PHP 4.2.3
 
Database
 -MS SQL 2000
 
Client Netscape 7.0
Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.0.1) Gecko/20020823
Netscape/7.0
 
<?
   $username = 'dbusername';
   $password = 'dbpassword';
 
   $connection = mssql_connect('192.168.168.168',$username,$password);
?>
 
 
 
Thank you
Charles Killmer
Windows 2000 Server PHP 4.2.3 IIS 5.0
--- End Message ---
--- Begin Message ---
Hi,

IE and Netscape works diffenntly when used on a LAN. IE can/will pass
along your user identification information (if you are validated on the
network) This information will be used when you are contacting the sql
server.

Netscape does not send this extra information from the client to the
server.

To avoid this you should make sure your IIS user (the user that runs the
server demon) has access to the SQL server or you should use SQL servers
internal authentication. This might require re-configuration of the sql
server.

- Frank

> PHP Warning:  MS SQL error:  Unable to connect: SQL Server is
> unavailable or does not exist. (severity 9) in pathtofile\test.php4 on
> line 5
> PHP Warning:  MS SQL:  Unable to connect to server:  192.168.168.168 in
> pathtofile\test.php4 on line 5
>  
>  
> Why would I get these errors when I access a php file with Netscape 7
> and not when I access the same file with IE 6.  I can switch back and
> forth as fast as I can and every request from IE works and every
request
> from Netscape fails.  So it isn't a timing issue where the SQL Server
is
> going away for a second.
>  
> If I continue the file and try to run queries to test the connection,
> the queries verify the errors.  IE They don't run when requested by
> Netscape 7 and they do when requested by IE 6
>  
> This is my setup
>  
> IIS 5.0
>  -Virtual Site
>  -Directory security: basic
>   -Anonymous Access: Disallowed
>  -PHP 4.2.3
>  
> Database
>  -MS SQL 2000
>  
> Client Netscape 7.0
> Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.0.1)
Gecko/20020823
> Netscape/7.0
>  
> <?
>    $username = 'dbusername';
>    $password = 'dbpassword';
>  
>    $connection = mssql_connect('192.168.168.168',$username,$password);
> ?>
>  
>  
>  
> Thank you
> Charles Killmer
> Windows 2000 Server PHP 4.2.3 IIS 5.0
> 



--- End Message ---
--- Begin Message ---
hay pat 

check out ur password and user
and make sure ur user has all the privilleges to connect to the db
try to grant privilleges to ur user all over again .....

n there aint anythin relavet to it on the manul except fo r the grant
privilleges section ......


hope ive helped ......

good luck

toby ...... 


--- Pat Johnston <[EMAIL PROTECTED]> wrote: > Hi
> I'm new at Apache, PHP, MySQL, but have been going okay on my
> win2000
> machine. For months, it's been good.
> 
> But for reason, I get this message when I try to do stuff with
> mysqladmin
> 
> ******
> mysqladmin: connect to server at 'localhost' failed
> error: 'Can't connect to MySQL server on 'localhost' (10061)'
> ******
> 
> Have I done something to cause this?
> 
> My development sites on 'localhost' just come up with a warning
> that it
> can't connect to retrieve data from the MySQL database.
> 
> I know it may be a small problem, but I can't work it out..
> I've read the manuals but I can't see anything relevant to it..
> 
> Thanks in advance
> 
> Pat
> 
> 
> 
> 
> -- 
> PHP Windows Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>  

__________________________________________________
Do You Yahoo!?
Everything you'll ever need on one web page
from News and Sport to Email and Music Charts
http://uk.my.yahoo.com
--- End Message ---

Reply via email to