• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 219
  • Last Modified:

php4 array worked, now with 5 it doesnt.

php5
RHEL 5
PHP Notice:  Undefined offset:  0 in /usr/me/index.php on line 18, referer:
Line 18 is if (is_array($myDB->row[0])){
==========================================================================================

$myDB = new DB($server,$database);
                $myqry = "SELECT * FROM _Users where Usr_Email = '$email' and Usr_Pass = '$pass'";
                $results = $myDB->DB_execute($myqry, "view");

                if (is_array($myDB->row[0])){

                        setcookie("Usr[ID]", $myDB->row[0][0]);
                        setcookie("Usr[Fname]", $myDB->row[0][1]);
                        setcookie("Usr[Lname]", $myDB->row[0][2]);
                        setcookie("Usr[Email]", $myDB->row[0][3]);
                        setcookie("Usr[Archive]", 0);

0
ucfperson
Asked:
ucfperson
  • 2
  • 2
1 Solution
 
gatorvipCommented:
What is the relevant code for the DB class?
Are you connecting properly?
Does DB have a variable called "row"?

...
0
 
ucfpersonAuthor Commented:
class DB {
         
          var ........
          var $row=array()

I am connecting properly.
0
 
gatorvipCommented:
it's hard to guess without seeing any actual code (for example: how do you populate myDB->row[0],  how do you know that myqry returns valid results, etc).
0
 
ucfpersonAuthor Commented:
Fixed it,   moved the pages from php4 to php5 and the database,   the passwds needed to be re encrypted.  
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

Join & Write a Comment

Featured Post

Ultimate Tool Kit for Technology Solution Provider

Broken down into practical pointers and step-by-step instructions, the IT Service Excellence Tool Kit delivers expert advice for technology solution providers. Get your free copy now.

  • 2
  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now