Re: contant /
| From: | Andre Polykanine | Date: | Thu, 08 Apr 2010 16:51:06 +0000 |
| Subject: | Re: contant / | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-303916@lists.php.net to get a copy of this message | ||
Hello Jack,
I have tons of errors like this and now I'm eliminating them, so I'll
tell what to do:
1. Put apostrophes (single quotes) around the array item:
$auth['company_name'] instead of $auth[company_name];
2. (Just a suggestion) It's better to put the SQL tables and
fields between grave accents (backquotes).
--
With best regards from Ukraine,
Andre
Skype: Francophile; Wlm&MSN: arthaelon @ yandex.ru; Jabber: arthaelon @ jabber.org
Yahoo! messenger: andre.polykanine; ICQ: 191749952
Twitter: m_elensule
----- Original message -----
From: Jack <JackListMail@Gmail.com>
To: php-general@lists.php.net <php-general@lists.php.net>
Date: Thursday, April 8, 2010, 7:26:56 PM
Subject: [PHP] contant /
I get a couple of errors like this one for undefined variable:
PHP Notice: Undefined variable: s_company_name
And this one for undefined contstant
PHP Notice: Use of undefined constant account_type - assumed 'account_type'
I am putting a piece of code from each so that hopefully someone can explain
what I need to do to correct this, I know it still runs OK, but want to
eliminate error/warnings as much as possible.
CONSTANT CODE:
if($_POST) {
if($username && $password)
{
f_db_open();
$q = mysql_query("SELECT * FROM uas_users WHERE
user_email='$username'");
$auth = mysql_fetch_array($q);
if($auth['user_password'] == $password && $auth['user_email'] ==
$username && $auth['account_status'] == "Approved")
{
$type = $auth['account_type'];
mysql_query("INSERT INTO logon_log (user, date, time)
VALUES ('$username', NOW(), NOW())");
f_put_cookie($auth[user_name],$auth[user_email],$auth[account_type],$auth[co
mpany_name]);
VARIABLE CODE:
function f_option_menu($status_message ) {
global $s_url, $s_logo, $s_logo_h, $s_logo_w;
echo "
<table border='0' width='100%' cellpadding='0'
cellspacing='0'>
<tr>
<td>
<img border=0 src='images/".$s_logo."' width=".$s_logo_w."
height=".$s_logo_h.">
<font face='Verdana, Arial'
size='3'><b>".$s_company_name."
".$status_message."</b></font>
THANKS!!!!
Thanks!
Jack