php-windows Digest 10 Apr 2001 20:33:31 -0000 Issue 537

Topics (messages 6596 through 6615):

Re: MSSQL Connect problems
        6596 by: Nasko
        6597 by: Svensson, B.A.T.

readfile() syntax
        6598 by: Antonio Minucci
        6603 by: Yasuo Ohgaki

Error wirth Max() PHP4NT / ORA81 / ODBC...
        6599 by: FX Liagre

Permissions on Nt 4.0
        6600 by: George Rae
        6602 by: Phil Driscoll

Mail(), PHP and Apach
        6601 by: Guillaume ARNAUD

PHP/MySQL Help
        6604 by: Bob Sears
        6605 by: Tom Mathews
        6606 by: Svensson, B.A.T.
        6607 by: Tom Mathews
        6608 by: Svensson, B.A.T.

Exec()
        6609 by: Helmut Himmelstoss

PHPLIB, IIS5.0 , PHP404 --> MSSQL Error
        6610 by: Helmut Himmelstoss
        6612 by: Svensson, B.A.T.
        6613 by: Helmut Himmelstoss

MSCOMCTL.OCX
        6611 by: Apokalypso

Re: FATAL:  emalloc():  Unable to allocate 2147483599 bytes
        6614 by: joerg andreas

HTML-Forms with the method POST
        6615 by: Monello

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]


----------------------------------------------------------------------


Is it the same DB server you're trying to connect to from locally run
scripts that you connect when the scripts are run from your hosting
server?
It does matter, because my hosting company for example has forbidden
any access to their DB servers for IP addresses different from the
addresses their virtual webs are run on. Thus the only way I can
access my DB's (for administration purposes)is using phpMyAdmin which
is run from their web site, or from within my scripts - which are also
run on their machine and respectively their IP address - you should
check with your hosting company to clear these issues out.
""Thomas W. Badera"" <[EMAIL PROTECTED]> wrote in message
001301c0c11a$dcf2e430$b8989980@black">news:001301c0c11a$dcf2e430$b8989980@black...
> Hello -
>
> I'm trying to debug some scripts locally before I send them to my
server.
> When the scripts are on the server they have no problem connecting
to the
> MSSQL sever, but when run from my machine I can't get it to
establish a
> connection.  Any thoughts?
>
> --TWB
>
>
> --
> PHP Windows 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]
>






First: what method are you using to connect? ODBC?

IF you are using ODBC, then you might check weather you are using named
pipes or
not to connect to the server. If named pipes not work, change to TCP/IP -
some
times named pipes are not allowed because of security reasons.

Second, it might be related to authentication checking. Check weather you
are
using NT authentication or if you are using SQL Server authentication.

        /Anders

>-----Original Message-----
>From: Thomas W. Badera [mailto:[EMAIL PROTECTED]]
>Sent: Monday, April 09, 2001 7:31 PM
>To: [EMAIL PROTECTED]
>Subject: [PHP-WIN] MSSQL Connect problems
>
>
>Hello -
>
>I'm trying to debug some scripts locally before I send them to my server.
>When the scripts are on the server they have no problem connecting to the
>MSSQL sever, but when run from my machine I can't get it to establish a
>connection.  Any thoughts?
>
>--TWB




hi.
i work on win 2000 with phptriad(apache+php4.0).
i need to know the syntax of readme() function.
now i've the file "projects.html" on c:\apache\htdocs\.
in index.php(on the same directory) i wrote:
<?
readfile("projects.html")
?>
but the browser say:
Warning: readfile("projects.html") - No such file or directory in
c:\apache\htdocs\prova.php on line 5

somebody can help me?
thanks
antonio







Check your include_path in php.ini. If you want to open files like that, you
should have "." in include_path.

Regards,
--
Yasuo Ohgaki


"Antonio Minucci" <[EMAIL PROTECTED]> wrote in message
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
> hi.
> i work on win 2000 with phptriad(apache+php4.0).
> i need to know the syntax of readme() function.
> now i've the file "projects.html" on c:\apache\htdocs\.
> in index.php(on the same directory) i wrote:
> <?
> readfile("projects.html")
> ?>
> but the browser say:
> Warning: readfile("projects.html") - No such file or directory in
> c:\apache\htdocs\prova.php on line 5
>
> somebody can help me?
> thanks
> antonio
>
>
>
>
> --
> PHP Windows 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]
>





Hi all,

Got a BIG problem when trying to use a php site with Oracle (the same thing
works perfectly with DB2-udb).

My config is :

NT4sp4
Apache 1.3.14
php4.0.4pl1 (Apache module)
Oracle 8.1.6

I try to determine the maximum value for a column, in this kind of script :


<?php
$Req='SELECT max(NUMEROSITE) FROM SITE';
$link = odbc_connect("FIDEX", 'fidex','fidex', SQL_CUR_USE_ODBC);
$Res_ID = odbc_exec($link,$Req);

Echo '<BR>Result ID='.$Res_ID;
$NF = odbc_num_fields($Res_ID);
Echo '<BR>Number of fields in result='.$NF;

$Cpt=1;
while(odbc_fetch_row($Res_ID)) {
 echo '<br>err='.odbc_error();
 $Resu[$Cpt] = odbc_result($Res_ID,1);
 $Cpt++;
}
Echo "<br>Number of lines in result=".count($Resu);
for ($i=1; $i<=count($Resu); $i++) {
  ECHO '<br>valeur="'.$Resu[$i].'"<br>';
}
$Res_ID = odbc_commit($link);
odbc_close($link);
?>


The table SITE contains several lines, and the current maximum NUMEROSITE
value is 10 (INTEGER column). If I try the request in the SQL*Plus
Worksheet, or using the Oracle ODBC Test, I have the correct answer: 1 line
saying "10".

If I execute the php script, the result is the following :

Result ID=Resource id #2
Number of fields in result=1
Number of lines in result=0

If I try to use another cursor parameter for my connect order, the result
is... Exception in Apache.exe "the memory couln't be written" !!!

In this case, the error seems to be generated by an endless loop
(odbc_fetch_row is always true, by there is no result)...

Any idea ?

TIA

--
FX Liagre

[EMAIL PROTECTED]
[EMAIL PROTECTED]








> I am trying to setup the permissions on an NT 4.0 box
> with an NTFS partition. When running a PHP script to create a new file it
> will not allow access. Any help would be appreciated.
> 
> 
> Regards
> 
> George Rae
> 





Just make sure that the directory you want to write into has write
permissions for IUSR_<machinename>

Cheers
--
Phil Driscoll
Dial Solutions
+44 (0)113 294 5112
http://www.dialsolutions.com
http://www.dtonline.org







Hi, I am a new user to PHP and Would like to use PHP to send mail.
I use the following script:
<?php
 $recipient = "[EMAIL PROTECTED]";
 $subject = "some subject";
 $mail_cont = "yea yea yea";
 $mail_headers = "From: our web site\n";

 if(mail($recipient,$subject,$mail_cont,$mail_headers))
  print("Success!");
 else
  print("Sorry, try again.");
?>

and I get

Warning: Unknown error in c:/easyphp/www/index3.php on line 7
Sorry, try again.

My php.ini file include:

[mail function]
SMTP=smtp.tele2.pl ;for win32 only
[EMAIL PROTECTED] ;for win32 only

Can u help?

THanx





I am no stranger to programming, having done that professionally for 30+ 
years; however,
PHP is a new animal to me. As usual, the text I have leave a little to be 
desired. The
reason for this email is to ask for a little assistance in getting over a 
coding "speed
bump".

I am rewriting a shopping cart application for a local retailer. It was 
originally an
informational site; but, with the request to add 2,500 items to his virtual 
store shelf
I went into total rewrite mode. I had originally thought of using Access as 
the data base
and mentioned this to my Java instructor last fall. He suggested I use PHP 
and MySQL since
I'm on a Unix machine.

I am not developing the maintenance routine. The tables have been created 
and the data
base populated. All I want to do is access the tables to effect updates, 
deletes, and
additions. There is the snag. I keep getting "object not defined" from PHP. 
Once I
correct this, I feel I will be in a better position to continue with the 
order processing
part, which is now a client-side Javascript routine.

The code follows. If you could show me what I am going wrong, I would 
certainly appreciate
the help. Matter of fact, I'd appreciate any pointers I could get.

The essence of this module is:

On initial entry, display the first 15 or so records from the data base;
Whenever the "forward" button is pressed, display the next 15 records;
Whenever the "backward" button is pressed, go backwards 15 records;
Be able to go to the first record in the file;
Be able to go to the last record in the file;
Modify a record;
Add a record;
Delete a record;

The code below is the portion that I want to be able to page forward and 
backward
in the file. The table has seven entries, displayed on at a time rather 
than all
seven on the page. This is because the product and customer tables have 
thousands
of records and I want to be able to page through them record by record.

<?

/*

   Module:  show_vendor.php

   Function:

   1)  When called from the root module [], this program displays the first
       vendor in the vendors MySQL database.

   2)  Present the user with options of:
       a)    Forward paging, with wrap around;
       b)    Reverse paging, with wrap around;
       c)    Modify the displayed vendor record;
       d)    Add a new vendor record;
       e)    Delete the displayed vendor record;

*/

//class show_vendor
//{

   $db_name = "healthspot";
   $table_name = "vendors";
   $connection = mysql_connect ("localhost","","") or die ("Couldn't 
connect to localhost");
   $db = mysql_select_db ($db_name, $connection) or die ("Couldn't select 
$db_name");

   $sql_statement =
        "
         SELECT Vactive, Vname, Vlogo_loc, Vlogo_height, Vlogo_width, 
Valink, Vdiscount
             FROM $table_name
           ";

   $result = mysql_query ($sql_statement, $connection) or die ("Couldn't 
execute msql_query:  [$sql_statement]");

   $rowmax = $number_of_rows = mysql_numrows($result);
   $rowmax--;
   $rowmin = 0;
   $TableRecord = -1;
   $Sequence = 2;

   function Advance_retreat($operation){

     GLOBAL $TableRecord;
     GLOBAL $Sequence;
     global $rowmax, $rowmin, $i;
     GLOBAL $db_name;
     GLOBAL $table_name;
     GLOBAL $connection;
     global $Sequence;

     $Sequence = 1;

/*
   print "<BR><BR>-->  In function Advance_retreat before Retrieve call<BR>\n";
   print "rowmax  :  $rowmax  rowmin:  $rowmin  Sequence:  $Sequence<br>\n";
   print "operation:  $operation<BR>\n";
*/

     switch ($operation)
     {
         case 'L':
             $TableRecord = $rowmax;
             break;
         case '1':
             $TableRecord = $rowmin;
             break;
         case '-':
             if (($TableRecord - 1) < 0){
                 $TableRecord = $rowmax;
             } else {
                 --$TableRecord;
             }
             break;
         case '+':
             break;
         case 'A':
             break;
         case 'D':
             break;
         case 'M':
             break;
     }                                  // end of switch statement

     $db = mysql_select_db ($db_name, $connection) or die ("Couldn't select 
$db_name");

     $sql_statement =
          "
            SELECT Vactive, Vname, Vlogo_loc, Vlogo_height, Vlogo_width, 
Valink, Vdiscount
               FROM $table_name
            LIMIT $TableRecord, 1
             ";

     $result = mysql_query ($sql_statement, $connection) or die ("Couldn't 
execute msql_query:  [$sql_statement]");

     while ($row = mysql_fetch_array($result)){
       $vactive  = $row['Vactive'];
       if ($vactive == 0){
         $vactive = "No";
       } else if ($vactive == 1){
         $vactive = "Yes";
       }
       $vname = $row['Vname'];
       $vlogo = $row['Vlogo'];
       $vlogo_height = $row['Vlogo_height'];
       $vlogo_width = $row['Vlogo_width'];
       $valink = $row['Valink'];
       $vdiscount = $row['Vdiscount'];

/*
print "RETRIEVED --> vname       : $vname<BR>\n";
print "RETRIEVED --> vlogo_height: $vlogo_height<BR>\n";
print "RETRIEVED --> vdiscount   : $vdiscount<BR>\n";
*/

     }                                  // end of while loop

     $Sequence = 3;

     $temp = $GLOBALS['vname'];

/*
   print "<BR>-->  In function Advance_retreat after Retrieve call<BR>\n";
   print "Sequence    : $Sequence<BR>\n";
   print "vactive     : $vactive<BR>\n";
   print "vname       : $vname<BR>\n";
   print "vlogo       : $vlogo<BR>\n";
   print "vlogo_height: $vlogo_height<BR>\n";
   print "vlogo_width : $vlogo_width<BR>\n";
   print "valink      : $valink<BR>\n";
   print "vdiscount   : $vdiscount<BR>\n";
   print "globals[vname]:  $temp<BR>\n";
*/

     $display_block  = "<H3 STYLE=\"position: absolute; left: 525; top: 
200\">$vactive</H3>";
     $display_block .= "<H3 STYLE=\"position: absolute; left: 525; top: 
220\">$vname</H3>";
     $display_block .= "<H3 STYLE=\"position: absolute; left: 525; top: 
240\">$vlogo</H3>";
     $display_block .= "<H3 STYLE=\"position: absolute; left: 525; top: 
260\">$vlogo_height</H3>";
     $display_block .= "<H3 STYLE=\"position: absolute; left: 525; top: 
280\">$vlogo_width</H3>";
     $display_block .= "<H3 STYLE=\"position: absolute; left: 525; top: 
300\">$valink</H3>";
     $display_block .= "<H3 STYLE=\"position: absolute; left: 525; top: 
320\">$vdiscount</H3>";

     echo $display_block;

   }                                    // end of Advance_Retreat function
//}                                       end of class definition
?>
<?php Advance_retreat('1'); ?>



As the usual case with anything pertaining to IT, this should have been 
done months ago.



Bob Sears
Owner
WebWyshez
[EMAIL PROTECTED]
www.on-net.net/~rsears/webwyshez/webwyshez.html





Try using the table name instead of a variable containing the table name.
If you must use $tablename within the SQL statement then you should include it in
quotes.
The error that you are getting is basically saying that MySQL can't find the table
that you are looking for, which is true as you have a table named 'vendors', but
not one named'$tablename'!

Using quotes (and remebering to escape them) may or may not cure the problem - it
seems to be a bit intermittent. It's more reliable just to hard code the tablename
instead.

Tom

Bob Sears wrote:

> I am no stranger to programming, having done that professionally for 30+
> years; however,
> PHP is a new animal to me. As usual, the text I have leave a little to be
> desired. The
> reason for this email is to ask for a little assistance in getting over a
> coding "speed
> bump".
>
> I am rewriting a shopping cart application for a local retailer. It was
> originally an
> informational site; but, with the request to add 2,500 items to his virtual
> store shelf
> I went into total rewrite mode. I had originally thought of using Access as
> the data base
> and mentioned this to my Java instructor last fall. He suggested I use PHP
> and MySQL since
> I'm on a Unix machine.
>
> I am not developing the maintenance routine. The tables have been created
> and the data
> base populated. All I want to do is access the tables to effect updates,
> deletes, and
> additions. There is the snag. I keep getting "object not defined" from PHP.
> Once I
> correct this, I feel I will be in a better position to continue with the
> order processing
> part, which is now a client-side Javascript routine.
>
> The code follows. If you could show me what I am going wrong, I would
> certainly appreciate
> the help. Matter of fact, I'd appreciate any pointers I could get.
>
> The essence of this module is:
>
> On initial entry, display the first 15 or so records from the data base;
> Whenever the "forward" button is pressed, display the next 15 records;
> Whenever the "backward" button is pressed, go backwards 15 records;
> Be able to go to the first record in the file;
> Be able to go to the last record in the file;
> Modify a record;
> Add a record;
> Delete a record;
>
> The code below is the portion that I want to be able to page forward and
> backward
> in the file. The table has seven entries, displayed on at a time rather
> than all
> seven on the page. This is because the product and customer tables have
> thousands
> of records and I want to be able to page through them record by record.
>
> <?
>
> /*
>
>    Module:  show_vendor.php
>
>    Function:
>
>    1)  When called from the root module [], this program displays the first
>        vendor in the vendors MySQL database.
>
>    2)  Present the user with options of:
>        a)    Forward paging, with wrap around;
>        b)    Reverse paging, with wrap around;
>        c)    Modify the displayed vendor record;
>        d)    Add a new vendor record;
>        e)    Delete the displayed vendor record;
>
> */
>
> //class show_vendor
> //{
>
>    $db_name = "healthspot";
>    $table_name = "vendors";
>    $connection = mysql_connect ("localhost","","") or die ("Couldn't
> connect to localhost");
>    $db = mysql_select_db ($db_name, $connection) or die ("Couldn't select
> $db_name");
>
>    $sql_statement =
>         "
>          SELECT Vactive, Vname, Vlogo_loc, Vlogo_height, Vlogo_width,
> Valink, Vdiscount
>              FROM $table_name
>            ";
>
>    $result = mysql_query ($sql_statement, $connection) or die ("Couldn't
> execute msql_query:  [$sql_statement]");
>
>    $rowmax = $number_of_rows = mysql_numrows($result);
>    $rowmax--;
>    $rowmin = 0;
>    $TableRecord = -1;
>    $Sequence = 2;
>
>    function Advance_retreat($operation){
>
>      GLOBAL $TableRecord;
>      GLOBAL $Sequence;
>      global $rowmax, $rowmin, $i;
>      GLOBAL $db_name;
>      GLOBAL $table_name;
>      GLOBAL $connection;
>      global $Sequence;
>
>      $Sequence = 1;
>
> /*
>    print "<BR><BR>-->  In function Advance_retreat before Retrieve call<BR>\n";
>    print "rowmax  :  $rowmax  rowmin:  $rowmin  Sequence:  $Sequence<br>\n";
>    print "operation:  $operation<BR>\n";
> */
>
>      switch ($operation)
>      {
>          case 'L':
>              $TableRecord = $rowmax;
>              break;
>          case '1':
>              $TableRecord = $rowmin;
>              break;
>          case '-':
>              if (($TableRecord - 1) < 0){
>                  $TableRecord = $rowmax;
>              } else {
>                  --$TableRecord;
>              }
>              break;
>          case '+':
>              break;
>          case 'A':
>              break;
>          case 'D':
>              break;
>          case 'M':
>              break;
>      }                                  // end of switch statement
>
>      $db = mysql_select_db ($db_name, $connection) or die ("Couldn't select
> $db_name");
>
>      $sql_statement =
>           "
>             SELECT Vactive, Vname, Vlogo_loc, Vlogo_height, Vlogo_width,
> Valink, Vdiscount
>                FROM $table_name
>             LIMIT $TableRecord, 1
>              ";
>
>      $result = mysql_query ($sql_statement, $connection) or die ("Couldn't
> execute msql_query:  [$sql_statement]");
>
>      while ($row = mysql_fetch_array($result)){
>        $vactive  = $row['Vactive'];
>        if ($vactive == 0){
>          $vactive = "No";
>        } else if ($vactive == 1){
>          $vactive = "Yes";
>        }
>        $vname = $row['Vname'];
>        $vlogo = $row['Vlogo'];
>        $vlogo_height = $row['Vlogo_height'];
>        $vlogo_width = $row['Vlogo_width'];
>        $valink = $row['Valink'];
>        $vdiscount = $row['Vdiscount'];
>
> /*
> print "RETRIEVED --> vname       : $vname<BR>\n";
> print "RETRIEVED --> vlogo_height: $vlogo_height<BR>\n";
> print "RETRIEVED --> vdiscount   : $vdiscount<BR>\n";
> */
>
>      }                                  // end of while loop
>
>      $Sequence = 3;
>
>      $temp = $GLOBALS['vname'];
>
> /*
>    print "<BR>-->  In function Advance_retreat after Retrieve call<BR>\n";
>    print "Sequence    : $Sequence<BR>\n";
>    print "vactive     : $vactive<BR>\n";
>    print "vname       : $vname<BR>\n";
>    print "vlogo       : $vlogo<BR>\n";
>    print "vlogo_height: $vlogo_height<BR>\n";
>    print "vlogo_width : $vlogo_width<BR>\n";
>    print "valink      : $valink<BR>\n";
>    print "vdiscount   : $vdiscount<BR>\n";
>    print "globals[vname]:  $temp<BR>\n";
> */
>
>      $display_block  = "<H3 STYLE=\"position: absolute; left: 525; top:
> 200\">$vactive</H3>";
>      $display_block .= "<H3 STYLE=\"position: absolute; left: 525; top:
> 220\">$vname</H3>";
>      $display_block .= "<H3 STYLE=\"position: absolute; left: 525; top:
> 240\">$vlogo</H3>";
>      $display_block .= "<H3 STYLE=\"position: absolute; left: 525; top:
> 260\">$vlogo_height</H3>";
>      $display_block .= "<H3 STYLE=\"position: absolute; left: 525; top:
> 280\">$vlogo_width</H3>";
>      $display_block .= "<H3 STYLE=\"position: absolute; left: 525; top:
> 300\">$valink</H3>";
>      $display_block .= "<H3 STYLE=\"position: absolute; left: 525; top:
> 320\">$vdiscount</H3>";
>
>      echo $display_block;
>
>    }                                    // end of Advance_Retreat function
> //}                                       end of class definition
> ?>
> <?php Advance_retreat('1'); ?>
>
> As the usual case with anything pertaining to IT, this should have been
> done months ago.
>
> Bob Sears
> Owner
> WebWyshez
> [EMAIL PROTECTED]
> www.on-net.net/~rsears/webwyshez/webwyshez.html
>
> --
> PHP Windows 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]




>Using quotes (and remebering to escape them) may or may not cure the
problem - it
>seems to be a bit intermittent. It's more reliable just to hard code the
tablename
>instead.

Yes, and then someone suddenly makes changes in the database schema - and
all your scripts stops to work... :)




True enough, but life's just a bitch sometimes! I don't create the problems,
just work around them.


"Svensson, B.A.T." wrote:

> >Using quotes (and remebering to escape them) may or may not cure the
> problem - it
> >seems to be a bit intermittent. It's more reliable just to hard code the
> tablename
> >instead.
>
> Yes, and then someone suddenly makes changes in the database schema - and
> all your scripts stops to work... :)
>
> --
> PHP Windows 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]




LOL! True enough! True enough!

>-----Original Message-----
>From: Tom Mathews [mailto:[EMAIL PROTECTED]]
>Sent: Tuesday, April 10, 2001 4:41 PM
>Cc: [EMAIL PROTECTED]
>Subject: Re: [PHP-WIN] PHP/MySQL Help
>
>
>True enough, but life's just a bitch sometimes! I don't create 
>the problems, just work around them.




HI,

system(), exec() etc. don't work properly under Windows.
they just don't hand back the output.

Has anyone got these functions working (e.g. Ping.exe)??

THX Helmut










Hello,

after getting the mssql functions to work I ran into a strange
problem: I can do inserts, deletes, and selects on records in my database.

When I call the script:
------------------------------------------------><--------------------------
-----------------------------------
<?php
    $db = new DB_Example("UPDATE csm_hosts set subnetz='neues_netz' WHERE
subnetz='test'" );
?>
------------------------------------------------><--------------------------
-----------------------------------

I got:
------------------------------------------------><--------------------------
-----------------------------------
Database error: Invalid SQL: UPDATE csm_hosts set subnetz='neues_netz' WHERE
subnetz='test'
MSSQL Error: 1 (General Error (The MSSQL interface cannot return detailed
error messages).)
Session halted.
------------------------------------------------><--------------------------
-----------------------------------

My System: Win2000, IIS5.0, php404pl1, phplib-7.2c, SQLServer2000


WHY??!?!?!?!?!?

THX
Helmut







A "General error" can occur when you are trying to connect to
the database. But this seams not be your problem in this case?

I am going for a long shot here:

Is it possible that you have ended up in SQL-state HY000 or HY004?
If you are in HY004, then your data types are incorrect!!!

Is really csm_hosts.subnetz a char/varchar?
If so, what is the maximum length of csm_hosts.subnetz?

E.g. is it true that:

subnetz char(x) or subnetz varchar(x)
          implies
x >= datalenght('neues_netz')?

If you are in SQL state HY000, then, hmm... well... good luck! :)
(In principle any ODBC function are allowed to return state HY004,
except for SQLError(), SQLGetDiagField() and SQLGetDiagRec()).

Best regards,

        /Anders

>-----Original Message-----
>From: Helmut Himmelstoss [mailto:[EMAIL PROTECTED]]
>Sent: Tuesday, April 10, 2001 8:15 PM
>To: [EMAIL PROTECTED]
>Subject: [PHP-WIN] PHPLIB, IIS5.0 , PHP404 --> MSSQL Error
>
>
>Hello,
>
>after getting the mssql functions to work I ran into a strange
>problem: I can do inserts, deletes, and selects on records in 
>my database.
>
>When I call the script:
>------------------------------------------------><-------------
>-------------
>-----------------------------------
><?php
>    $db = new DB_Example("UPDATE csm_hosts set 
>subnetz='neues_netz' WHERE
>subnetz='test'" );
>?>
>------------------------------------------------><-------------
>-------------
>-----------------------------------
>
>I got:
>------------------------------------------------><-------------
>-------------
>-----------------------------------
>Database error: Invalid SQL: UPDATE csm_hosts set 
>subnetz='neues_netz' WHERE
>subnetz='test'
>MSSQL Error: 1 (General Error (The MSSQL interface cannot 
>return detailed
>error messages).)
>Session halted.
>------------------------------------------------><-------------
>-------------
>-----------------------------------
>
>My System: Win2000, IIS5.0, php404pl1, phplib-7.2c, SQLServer2000
>
>
>WHY??!?!?!?!?!?
>
>THX
>Helmut
>
>
>
>
>-- 
>PHP Windows 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]
>




> Is it possible that you have ended up in SQL-state HY000 or HY004?
> If you are in HY004, then your data types are incorrect!!!

I don't understand:  HY000 or HY004 ???

>
> Is really csm_hosts.subnetz a char/varchar?
> If so, what is the maximum length of csm_hosts.subnetz?
>
> E.g. is it true that:
>
> subnetz char(x) or subnetz varchar(x)
>           implies
> x >= datalenght('neues_netz')?

is true :  [subnetz] [varchar] (20)

the Statement ("UPDATE csm_hosts set subnetz='neues_netz' WHERE
subnetz='test' ) is correct, because when I use MSQuery all Rows will
changed.

> If you are in SQL state HY000, then, hmm... well... good luck! :)
> (In principle any ODBC function are allowed to return state HY004,
> except for SQLError(), SQLGetDiagField() and SQLGetDiagRec()).
>
> Best regards,
>
> /Anders
>
> >-----Original Message-----
> >From: Helmut Himmelstoss [mailto:[EMAIL PROTECTED]]
> >Sent: Tuesday, April 10, 2001 8:15 PM
> >To: [EMAIL PROTECTED]
> >Subject: [PHP-WIN] PHPLIB, IIS5.0 , PHP404 --> MSSQL Error
> >
> >
> >Hello,
> >
> >after getting the mssql functions to work I ran into a strange
> >problem: I can do inserts, deletes, and selects on records in
> >my database.
> >
> >When I call the script:
> >------------------------------------------------><-------------
> >-------------
> >-----------------------------------
> ><?php
> >    $db = new DB_Example("UPDATE csm_hosts set
> >subnetz='neues_netz' WHERE
> >subnetz='test'" );
> >?>
> >------------------------------------------------><-------------
> >-------------
> >-----------------------------------
> >
> >I got:
> >------------------------------------------------><-------------
> >-------------
> >-----------------------------------
> >Database error: Invalid SQL: UPDATE csm_hosts set
> >subnetz='neues_netz' WHERE
> >subnetz='test'
> >MSSQL Error: 1 (General Error (The MSSQL interface cannot
> >return detailed
> >error messages).)
> >Session halted.
> >------------------------------------------------><-------------
> >-------------
> >-----------------------------------
> >
> >My System: Win2000, IIS5.0, php404pl1, phplib-7.2c, SQLServer2000
> >
> >
> >WHY??!?!?!?!?!?
> >
> >THX
> >Helmut
> >
> >
> >
> >
> >--
> >PHP Windows 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 Windows 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]
>






Where can I find the MSCOMCTL.OCX file ?
Do you have a link on MS's website ?

Thanks






Hi Denis,

after some nights of installations I think I have found the cause of this
error:
I also got this error on WIN2000Pro / IIS5 / PHP 4.0.5 inside a project with
MS Access 2000 - mdb ( linked via ODBC )

Everywhere I use odbc_connect... the emalloc() came.

In the office we are running NT4 SP3, IIS4 , PHP 4.0.4

At home I had installed:
1) W2K, IIS5, PHP 4.0.5
2) W2K, Apache 1.3, PHP 4.0.5
3) NT4, Apache, PHP 4.0.5

Both 1) and 2) had shown the error emalloc()
3) is running as stable as in the office

So I think the problem is caused by the new odbc-drivers of the W2K
Try to reinstall the older ones if you can't use NT4.
Good luck,

Joerg Andreas



""Denis Eltsov"" <[EMAIL PROTECTED]> schrieb im Newsbeitrag
99eukd$k9t$[EMAIL PROTECTED]">news:99eukd$k9t$[EMAIL PROTECTED]...
> I use win2000 SP1 - IIS5 - php4 (as CGI) - odbc connection to Access 2000
> Everything was fine until I install MS SQL 2000 to the same machine.
> After this I receive such a message
>
> FATAL:  emalloc():  Unable to allocate 2147483599 bytes
>
> every time I try to execute such a program
> <?
> $x=odbc_connect("oh","","");
> $r=odbc_exec($x,"select 'a' as a_leter from some_table");
> ?>
>
> ODBC works fine from any other program. select text_field from some_table
> all so works fine .
>
> Best regards Denis Eltsov
>
> P.S. I undestend what select 'a' as a_leter from some_table will return my
> "a" several times.
> This is an example of problem. :)
>
>
>
>
>
> --
> PHP Windows 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]
>






I have a strange problem with HTML-Forms with the method POST.

When I work local on my computer with the localhost, all data tipped into 
the form can be read from the HTTP_POST_VARS-system array.

But when I trie to use the form from a other computer connected to the 
internet, all the formdata are lost, the HTTP_POST_VAR-array is empty.

What happens hear ? What did I wrong ?

Thanks for your help.
Philipp


Reply via email to