php-windows Digest 21 Feb 2001 11:52:17 -0000 Issue 456

Topics (messages 5668 through 5671):

php4 + mysql character problems
        5668 by: Franky Lau

Trying to understand this OCI8 example
        5669 by: clever.ukl.uni-freiburg.de

Re: DNS question
        5670 by: Toby Butzon

Apache, PHP4, PHPLIB, include_path
        5671 by: Martin Burger

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]


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


i get a problem when using php4 under window,
when i change the mysql default-character-set to big5, i get a warning
message:

Warning: MySQL Connection Failed: Can't initialize character set 1 (path:
default) in XXX.php on line XX

But this only happen in php4, it work fine when i switch to php3.(Oh! why?)

Is there something missing?






Hi,

basically OCIFetchStatement fetches the complete results of your SELECT
into an array. Suppose you have the following SQL:
SELECT firstname, lastname, emp_id from employees
now your $results array will look like this:
$results["firstname"][0]="Florian"
$results["lastname"][0] = "Clever"
$results[emp_id"][0]=1
$results["firstname"][1]="John"
$results["lastname"][1] = "Asendorf"
$results[emp_id"][1]=1

So the first loop goes through and displays the $results array's keys,
which are the column headers of your SELECT statement.
The for-loop loops through all rows and siplays each row of your SELECT.
the while loop in that for-loop again loops through each element (to be
specific each SELECT column) and displays it's value.

BTW: I would not really use this code to display big result sets, because
Oracle has to return all rows (OPTIMIZER=ALL_ROWS) before execution can
continue after the OCIFetchStatement. Other approcaches, with each row at a
time will allow PHP to continue before Oracle actually fetched all values.

Florian

----------------
John Asendorf wrote:

I yanked this example off of the annotated manual and I'm trying to figure
out how/why one of the statements works...

The example puts all of the results from an Oracle select statement in to a
table.  I can make it work, but I want to customize it.  Unfortunately I
think I may just be too inexperienced to figure out what the hell is going
on...  I get everything up until the second "while" statement.

Can anyone explain to me what it's doing?  Would it be a bit easier to
understand if $column was renamed $row?  Is that more accurate?  What if I
wanted to format the data?  Would something like:

print "$data['row_name'], $data['row_name2'] $data[3] <br>";

work?

Maybe I'm way ahead of myself here...  anyone?  thanks in advance  John


$nrows = OCIFetchStatement($stmt,$results);
if ( $nrows > 0 ) {
   print "<TABLE BORDER=\"1\">\n";
   print "<TR>\n";
   while ( list( $key, $val ) = each( $results ) ) {
      print "<TH>$key</TH>\n";
   }
   print "</TR>\n";

   for ( $i = 0; $i < $nrows; $i++ ) {
      reset($results);
      print "<TR>\n";
      while ( $column = each($results) ) {
         $data = $column['value'];
         print "<TD>$data[$i]</TD>\n";
      }
      print "</TR>\n";
   }
   print "</TABLE>\n";

---------------------
John Asendorf - [EMAIL PROTECTED]
Web Applications Developer
http://www.lcounty.com - NEW FEATURES ADDED DAILY!
Licking County, Ohio, USA
740-349-3631
Aut insanit homo, aut versus facit






You need to see if you can find a commandline method of restarting the
service. For ex., the whole IIS service can be restarted with `net stop
w3svc` and `net start w3svc`. Perhaps there is a similar command for
bind?

--Toby

Richard wrote:
> 
> Does anyone do any configuring of a DNS server with php?  If so, what server
> do you use?
> I am currently using bind 4.x on my NT 4 server with IIS.  To add a new
> domain, you create a new .host file with the appropriate records in it (a,
> mx, etc) and then add that .host file to the named.boot file.  Then you
> restart the service.  It seems as though it would all be easy enough except
> for restarting the service.  How can I do that? Normally, I do it through
> the DNS program itself as opposed to the services applet under control
> panel...don't know if that matters.
> Does anyone have a solution for this or any other DNS servers?
> 
> Thanks,
> Rick
> 
> --
> 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]




Hello,

I  try  to  use  PHPLIB  with PHP4 on a machine running "Apache/1.3.14
(Win32) mod_jk PHP/4.0.4". With PHP3 (CGI) it works fine.

I  inserted the following lines in the .htaccess in the root-directory
of the virtual webserver (VirtualHost):


php_value auto_prepend_file d:\server\htdocs\www.test.de\php\prepend.php3

php_value include_path \server\htdocs\www.test.de\php\:./


So,  PHP4  finds  the  file  prepend.php3, but the 'required' files in
prepend.php3 are not found:


Fatal error: Failed opening required 'db_mysql.inc'
(include_path='d:\server\htdocs\www.test.de\php\:./') in
d:\server\htdocs\www.test.de\php\prepend.php3 on line 19


If I manually insert the path to db_mysql.inc, PHP4 will find the file
but  the  next file will be a problem. I even copied the path from the
error message.

Any ideas to solve this problem?

Regards,

Martin Burger



Reply via email to