Object declaration

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hi all,

In the ongoing saga of moving the application I've developed from Apache to
IIS, I've found another problem, with objects this time.

I've got a standard file that is included as a header, which includes the
following lines:

[script]
$query = "SELECT * FROM user where username='".$_COOKIE["username"]."' LIMIT
1"; 
$user_res=mysql_query($query) or die("Query failed : " . mysql_error()); 
while ($user_row=mysql_fetch_row($user_res)) {
	$user->username=$user_row["username"];
	$user->password=$user_row["password"];
	$user->agent_id=$user_row["agent_id"];
	$user->reference=$user_row["reference"];
	$user->level=$user_row["level"];
	$user->email_address=$user_row["email_address"];
	$user->email_username=$user_row["email_username"];
	$user->email_password=$user_row["email_password"];
}
[/script]

When I then try and recall the object variable $user->username it comes up
with an error:
Notice: Undefined variable: user in C:\www\portal\global\var_setup.php on
line 15

Notice: Trying to get property of non-object in
C:\www\portal\global\var_setup.php on line 15

What do I need to do to declare the object before I write sections to it?

Cheers
Nunners

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


[Index of Archives]     [PHP Home]     [PHP Users]     [PHP Database Programming]     [PHP Install]     [Kernel Newbies]     [Yosemite Forum]     [PHP Books]

  Powered by Linux