[PHP] Undefinded Index on Mysql Result under Win98/PWS

2001-02-23 Thread Greg Kopp

I am using PHP4 + MySQL + PWS + Windows 98.

We are trying to port over a web site to a laptop for remote use.

However, when we execute a SQL query on a DB in which a filed of the record
contains a NULL value, we get an error.

The code is as follows:

$GetQuery = mysql_query ("SELECT * FROM ApplicantsTbl WHERE App_ID = $qq");
$AppResult = mysql_fetch_array ($GetQuery);
$AppDOB = $AppResult[AppDOB];

The query executes just fine, and PARTS of the $AppResult array get
returned. However...

We are experiencing TWO problems:

First, unless we put quote marks around the index so it reads
$AppResult['AppDOB'], we get an undefined constant. This doesn't happen on
our Linux/Apache web server.

Second, if the field AppDOB contains a NULL value, PHP barks that there is
an undefined index. It appears that it won't even create the index.

I would appreciate any help you could be.

Greg


-- 
PHP General 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]




Re: [PHP] Undefinded Index on Mysql Result under Win98/PWS

2001-02-23 Thread Jason Stechschulte

On Fri, Feb 23, 2001 at 11:47:12AM -0700, [EMAIL PROTECTED] wrote:
 That might be good for a temporary solution, but not having quotes there
 ia a potential bug waiting to happen.  That is why it there is a warning
 about it.

I agree.  Since he didn't use the quotes on the live system though, I
took it to mean that he wasn't using many if any constants.  So it
should not be a problem to change the error reporting level.  

-- 
Jason Stechschulte
[EMAIL PROTECTED]
--
There's some entertainment value in watching people juggle nitroglycerin.
 -- Larry Wall in [EMAIL PROTECTED]

-- 
PHP General 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]