Re: [PHP] Count in PHP

2002-09-10 Thread xdrag

why not:
select count(*) as counter from table

- Original Message - 
From: Tyler Longren [EMAIL PROTECTED]
To: Chuck PUP Payne [EMAIL PROTECTED]
Cc: [EMAIL PROTECTED]
Sent: Tuesday, September 10, 2002 1:02 PM
Subject: Re: [PHP] Count in PHP


 $sql = mysql_query(SELECT * FROM table ORDER BY whatever);
 echo(mysql_num_rows($sql));
 
 that should do it.
 
 tyler
 
 On Tue, 10 Sep 2002 00:58:26 -0400
 Chuck \PUP\ Payne [EMAIL PROTECTED] wrote:
 
  I am wanting to do a count in PHP. I want to be able to count the
  number of records from a given database and display this count on the
  page. Can this be done using PHP or is the sql thing?
  
  Chuck Payne
  
  
  -- 
  PHP General Mailing List (http://www.php.net/)
  To unsubscribe, visit: http://www.php.net/unsub.php
 
 -- 
 PHP General Mailing List (http://www.php.net/)
 To unsubscribe, visit: http://www.php.net/unsub.php
 



[PHP] what's the latest version of PHPLib now?

2002-09-07 Thread xdrag

i can't visit http://phplib.netuse.de



Re: [PHP] Link for downloading?

2002-09-07 Thread xdrag

try this:

?php
... ...
$filename = test;
header(Cache-Control: no-cache, must-revalidate);
header(Content-type:.$mime_type);
header(Content-Disposition:filename=.$filename..doc); 
echo hello, world!;
?

- Original Message - 
From: Justin French [EMAIL PROTECTED]
To: Alex Shi [EMAIL PROTECTED]; [EMAIL PROTECTED]
Cc: [EMAIL PROTECTED]
Sent: Saturday, September 07, 2002 11:45 PM
Subject: Re: [PHP] Link for downloading?


 http://www.zend.com/zend/trick/tricks-august-2001.php
 
 the stuff he does with mime types and headers is all relevant to what you
 want to do...
 
 Justin
 
 
 on 07/09/02 1:56 AM, Alex Shi ([EMAIL PROTECTED]) wrote:
 
  Thanks for your reply! Still have another question: How to use
  header() to generate download link?
  
  Alex
  
  - Original Message -
  From: [EMAIL PROTECTED]
  To: Alex Shi [EMAIL PROTECTED]; [EMAIL PROTECTED]
  Sent: Friday, September 06, 2002 7:27 AM
  Subject: Re: [PHP] Link for downloading?
  
  
  Question 1:
  I think this has to do with how you attribute your file extensions in
  httpd.conf (Apache thing, not PHP), so check out the docs on apache.org
  
  Question 2:
  I woudl tend to believe it depends what kind of link it is...
  is it and HTTP downlaod site (which would use the windows save file as
  dialog, or is it a link to an FTP site, which may use your local FTP
  software...
  
  HTH
  -Brad
  
  Hello,
  
  How to create a link that when click it will lauch file downloading at
  client's end.
  
  And another question which might be biased from this topic, but
  still related with the subject of this message: why some downloading
  link will lauch a ftp client such as NetAnts or Download Accelerator
  while other link will start a Window's builtin download window?
  
  Alex
  
  -- 
  PHP General Mailing List (http://www.php.net/)
  To unsubscribe, visit: http://www.php.net/unsub.php
  
  
  
  
  
  
 
 
 -- 
 PHP General Mailing List (http://www.php.net/)
 To unsubscribe, visit: http://www.php.net/unsub.php
 



[PHP] header() problem!!!!

2002-09-07 Thread xdrag

Hi:
is this a bug?
[win98se + apache2.0.40 + PHP4.2.3 + IE6.0]

download1.php:
?php
...
header(Cache-Control: no-cache, must-revalidate);
header(Content-Type:.$mime_type);
header(Content-Disposition: filename=$filename);
echo $filedata;
?
works well

download2.php:
?php
...
header(Cache-Control: no-cache, must-revalidate);
header(Content-Type:.$mime_type);
header(Content-Disposition: attachment; filename=$filename);
echo $filedata;
?
please pay attention to header(Content-Disposition: ...)
if you click this URL, for example download2.php?id=1, then click the save button, 

your browser will suffer a fatal error. You can not do anything else now!