|
|
|||||||||
|
|||||||||
|
|||||||||
| |
|||
| |||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Display Modes |
|
|
|
Free Web 2.0 Code Generator! Generate data entry and reporting .NET Web apps in minutes. Quickly create visually stunning, feature-rich apps that are easy to customize and ready to deploy. Download Now!
|
|
#1
|
|||
|
|||
|
PHP Notice Problem
Why do I get this notice? And is there any way to get rid of it?
Notice: Use of undefined constant option - assumed 'option' in c:\...etc Here is the code: Code:
<?php
$sql = MYSQL_QUERY('SELECT `option` FROM `settings` WHERE `type` = \ 'window\ ' ');
$p_window = MYSQL_FETCH_ARRAY($sql);
if ($p_window[option] == 1) //error is on this line
{
echo "window option is 1";
}
?>
Thanks for any help ![]() Last edited by subduck : January 3rd, 2003 at 12:49 AM. |
|
#2
|
|||
|
|||
|
Use correct syntax: $p_window['option'], associative arrays are indexed by strings.
Hadley |
|
#3
|
|||
|
|||
|
you must be running your server on windows.
On windows servers when you have an array name, you must encase it in either ' or " echo $array['name']; on a linux server you dont need the ' or " but to be on the safe side, its still used. when you dont have the ' or " it asumes, its either a number, variable or constant. |
|
#4
|
|||
|
|||
|
Thanks guys that worked perfect
![]() Last edited by subduck : January 3rd, 2003 at 11:57 AM. |
![]() |
| Viewing: Dev Articles Community Forums > Programming > PHP Development > PHP Notice Problem |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
|
|