php-windows Digest 1 Nov 2004 06:28:48 -0000 Issue 2449

Topics (messages 24856 through 24860):

Re: Trouble with the ISAPI in PHP4
        24856 by: George Hester

Re: 3 is not a valid MySQL result resource
        24857 by: Ross Hulford

session expiration problem
        24858 by: nightwalker

Problems with mysql_num-rows()
        24859 by: Arne Essa Madsen

Displaying An Image / Non-Web accessible Dir
        24860 by: Armando

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 ---
OK it's fixed.  Thamks to all that provided some help.  I put all the files in /dll 
and /sapi in the root.  Just basically followed the directions here:

http://us2.php.net/install.windows.iis

-- 
George Hester
__________________________________
"George Hester" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED]
If I am loading extensions in my php.ini file then this is what happens when I try try 
load the php4isapi.dll.
I go ahead and add it as an ISAPI filter the way it supposed to be done in IIS 5.  
Then I stop the IISAdmin
Service and restart it.  Then I start the Web Puublishing Service. This is where the 
issue arises.  If I am loading
extensions in my php.ini then I will get errors, "./extensions\php_gd2.dll not found " 
for example of course loading
the php_gd2.dll extension in my php.ini.  The specific dll is not the issue.  It 
happens with any extension I have
loaded in my php.ini upon starting the Web Publishing Service.  Any ideas how to fix 
this? 
Thanks.

-- 
George Hester
__________________________________

--- End Message ---
--- Begin Message ---
This is my code...........................

<?php require_once('Connections/ross.php'); ?>
<?php
$maxRows_Recordset1 = 10;
$pageNum_Recordset1 = 0;
if (isset($_GET['pageNum_Recordset1'])) {
  $pageNum_Recordset1 = $_GET['pageNum_Recordset1'];
}
$startRow_Recordset1 = $pageNum_Recordset1 * $maxRows_Recordset1;

mysql_select_db($database_ross, $ross);
$query_Recordset1 = "SELECT portfolio.location_name FROM portfolio";
$query_limit_Recordset1 = sprintf("%s LIMIT %d, %d", $query_Recordset1, 
$startRow_Recordset1, $maxRows_Recordset1);
$Recordset1 = mysql_query($query_limit_Recordset1, $ross) or 
die(mysql_error());
$row_Recordset1 = mysql_fetch_assoc($Recordset1);

if (isset($_GET['totalRows_Recordset1'])) {
  $totalRows_Recordset1 = $_GET['totalRows_Recordset1'];
} else {
  $all_Recordset1 = mysql_query($query_Recordset1);
  $totalRows_Recordset1 = mysql_num_rows($all_Recordset1);
}
$totalPages_Recordset1 = ceil($totalRows_Recordset1/$maxRows_Recordset1)-1;

mysql_free_result($Recordset1);
?>
<?php echo $totalRows_Recordset1 ?>
<?php do { ?>
<p><?php echo $row_Recordset1['location_name']; ?></p>
<?php } while ($row_Recordset1 = mysql_fetch_assoc($Recordset1)); ?>






It displays one result then thows up the following error




Warning: mysql_fetch_assoc(): 3 is not a valid MySQL result resource in 
c:\inetpub\wwwroot\testy\Untitled-1.php on line 29

--- End Message ---
--- Begin Message --- Hi.
When I set session expiration using:
ini_set('session.gc_maxlifetime','3');
and I refresh page after 10 seconds or even change my system time to a few hours ahead, the session variables still exist. It doesn't work even if I change it directly in php.ini. I am running the Apache 2 with PHP 4.3.9 on my computer with WinXP.
Do you have any idea how to solve this?


Thanks.
--- End Message ---
--- Begin Message ---
I have the following problem:

This one does not work:
 $query = "SELECT * from user where name='$userid' and
pass=password('$password')";
  $result = mysql_query($query, $link);
  $num_rows = mysql_num_rows($result);

I get this error message:
Warning: mysql_num_rows(): supplied argument is not a valid MySQL result
resource in c:\wamp\www\fs1812_new\authmain.php on line 18

This one works OK:
  $query = "SELECT * FROM user";
  $result = mysql_query($query, $link);
  $num_rows = mysql_num_rows($result);

What is wrong and how can I use mysql_num_rows when the query include
"WHERE"

A fast response will be very much appreciated.

Arne Essa Madsen;
[EMAIL PROTECTED]

--- End Message ---
--- Begin Message ---
Greetings!

I'm porting all my old ASP websites to PHP and have run into a small
problem. One of my pages is a gallery in which images can (should) only
be viewed by authenticated users in my MySQL database. The images are
stored in a non-web accessible directory. For example.. say my root
website is in 'C:\www\webroot' and the gallery images are in
'C:\www\gallery'.

On my ASP page what I did was have the <img> tag call to an ASP page
which would open the file from the actual location on the disk, then
stream it to the page. ASP's filesystemobject and adodb stream
references open the file and do a binary-write to the page to display
the image. Since the page is ASCII and the image data is binary, you
cannot mix the two on the same page,  hence the reason for the <img> tag
calling to a separate ASP page.

Now my problem is I'd like to do the same thing in PHP but am not
exactly sure how to go about doing this. I've tried a number of the
filesystem references, but have had no luck so far. I'm assuming I have
to do a similar thing by having my <img> tag call to a PHP page to get
the image, which is easy enough, but I can't figure out how to display
the image from that page. I'm just not familiar enough with PHP yet to
do this.

Any help would be greatly appreciated! Cheers.

Armando

--- End Message ---

Reply via email to