Re: [PHP-DB] Re: If in a query

2003-09-28 Thread Director General: NEFACOMP
I think you are not considering all the cases.
Suppose your column is NULL for the first record but it has a non-NULL value
on the second record. So, why do you want your query to return nothing
whereas there are values in it?

Col1Col2Col3
__
Row1:18NULLabcdf
Row2:1628  jdgdkdkf

Do you see what I mean? Column 2 is NULL for the first record but it is 28
for the second record.

A query like:
SELECT col1, IFNULL(col2, 0) AS col22, col3 FROM tblName
will return

Col1Col2Col3
__
Row1:180abcdf
Row2:1628  jdgdkdkf


Thanks
Emery
- Original Message -
From: Shaun [EMAIL PROTECTED]
To: [EMAIL PROTECTED]
Sent: Saturday, September 27, 2003 15:43
Subject: [PHP-DB] Re: If in a query


 i'm sorry,

 i rushed that previous post!!!

 what i meant to ask was, if the value of B.Column1 is null then can the
 query be written such that we dont select A.Column2.

 Sorry!

 Shaun [EMAIL PROTECTED] wrote in message
 news:[EMAIL PROTECTED]
  Hi,
 
  is it possible to create a query with parameters such that it selects a
  field if it isn't null?
 
  for example:
 
  SELECT
A.Column1,
A.Column2,
(if not null, B.Column1)
  FROM Table1 A, Table2 B
 
  Thanks for your help

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




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



Re: [PHP-DB] mysql, finding the last record

2003-09-28 Thread Director General: NEFACOMP
For the last Auto-increment
SELECT LAST_INSERT_ID() FROM tblName;

For the last row data:
SELECT col1, col2, col3, col4 FROM tblName ORDER BY SortedColumn
LIMIT 1

I don't know what you are looking for exactly.
Explain and we will try to help though I am not an expert.


Thanks
Emery
- Original Message -
From: Joe Nilson Zegarra Galvez [EMAIL PROTECTED]
To: [EMAIL PROTECTED]
Sent: Friday, September 26, 2003 19:38
Subject: Re: [PHP-DB] mysql, finding the last record


 if you are seeking for the last in autoincrement field, in your select use
 this:

 select max(field) from table;

 if is other, well, i dont remember :D

 Regards

 Nilson

 John Ryan dijo:
  is there any quick way of selecting the 'last' row in a mysql table?? i
  could write some messy code but id prefer an elegant solution.
 
  --
  PHP Database Mailing List (http://www.php.net/)
  To unsubscribe, visit: http://www.php.net/unsub.php
 


 -
 Joe Nilson Zegarra Galvez
Sistemas Kola Real
  Telefax : 0051-54-256658
   Movil: 0051-54-9603244

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




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



Re: [PHP-DB] mysql, finding the last record

2003-09-28 Thread Director General: NEFACOMP
I forgot to add DESC for the ORDER BY clause:
...  ORDER BY SortedColumn DESC LIMIT 1


Thanks
Emery

- Original Message -
From: Director General: NEFACOMP [EMAIL PROTECTED]
To: [EMAIL PROTECTED]; [EMAIL PROTECTED]
Sent: Sunday, September 28, 2003 19:05
Subject: Re: [PHP-DB] mysql, finding the last record


 For the last Auto-increment
 SELECT LAST_INSERT_ID() FROM tblName;

 For the last row data:
 SELECT col1, col2, col3, col4 FROM tblName ORDER BY SortedColumn
 LIMIT 1

 I don't know what you are looking for exactly.
 Explain and we will try to help though I am not an expert.


 Thanks
 Emery
 - Original Message -
 From: Joe Nilson Zegarra Galvez [EMAIL PROTECTED]
 To: [EMAIL PROTECTED]
 Sent: Friday, September 26, 2003 19:38
 Subject: Re: [PHP-DB] mysql, finding the last record


  if you are seeking for the last in autoincrement field, in your select
use
  this:
 
  select max(field) from table;
 
  if is other, well, i dont remember :D
 
  Regards
 
  Nilson
 
  John Ryan dijo:
   is there any quick way of selecting the 'last' row in a mysql table??
i
   could write some messy code but id prefer an elegant solution.
  
   --
   PHP Database Mailing List (http://www.php.net/)
   To unsubscribe, visit: http://www.php.net/unsub.php
  
 
 
  -
  Joe Nilson Zegarra Galvez
 Sistemas Kola Real
   Telefax : 0051-54-256658
Movil: 0051-54-9603244
 
  --
  PHP Database Mailing List (http://www.php.net/)
  To unsubscribe, visit: http://www.php.net/unsub.php
 
 
 

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





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



[PHP-DB] Re: database design question

2003-09-28 Thread Shadow
From a design standpoint...I would have one table named ratings and
another named hits and link them using a key from the lyrics table.
Shadow

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



Re: [PHP-DB] Authentication using NTLM

2003-09-28 Thread Peter Monk
[EMAIL PROTECTED] wrote:

How can I authenticate users against the database using NTLM instead of
Basic Authentication?
Instead of manually logging in, each user's NT account will automatically
allow or deny access.
Is there somewhere in the php.ini file where I have to enable the NTLM
module?
Mark,

You need to get hold of mod_auth_sspi for Apache.
This succeeds the old mod_auth_ntlm, now out of development.
v1.0.1 for Apache 2.0.45 is the latest version I have found.

Here's the last location I have:
http://www.gknw.net/development/apache/httpd-2.0/win32/modules/
Add it to your httpd.conf file with something like:
LoadModule sspi_auth_module modules/mod_auth_sspi.so
It likes to be the last entry in your modules list.

Then switch on SSPI authentication in one of your httpd.conf
directory definitions:
Directory D:/
Options Indexes FollowSymLinks
AllowOverride None
Order allow,deny
Allow from all
# SSPI authentication
AuthName My secure area
AuthType SSPI
SSPIAuth On
SSPIAuthoritative On
require valid-user
/Directory
The require valid-user means that any user who is a
valid user of your domain (ie, has an NT account) will be
allowed in.
If I've left anything out the readme file in the mod
archive should fill in the blanks.  ;)
I've been using this solution successfully for about
two years, by the way.  Works very well.
Peter.

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


Re: [PHP-DB] Mozilla stops displaying the web page

2003-09-28 Thread Peter Monk
ed anderson wrote:

When running a PHP script (program), Mozilla stops displaying the web page
after using about 5mb of disk space.
Based on the percentage of source processed, I estimate I need about 200mb
of disk space.  Any method or procedure where all the data processed and
saved would be appreciated.
This may be a stupid question, but it's the first thing that came
to mind:
Is your Mozilla disk cache limit set to 5mb?

Peter.

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