Solved

php4 array worked, now with 5 it doesnt.

Posted on 2007-03-24
4
201 Views
Last Modified: 2010-04-16
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
Comment
Question by:ucfperson
  • 2
  • 2
4 Comments
 
LVL 20

Expert Comment

by:gatorvip
ID: 18793906
What is the relevant code for the DB class?
Are you connecting properly?
Does DB have a variable called "row"?

...
0
 

Author Comment

by:ucfperson
ID: 18794503
class DB {
         
          var ........
          var $row=array()

I am connecting properly.
0
 
LVL 20

Accepted Solution

by:
gatorvip earned 500 total points
ID: 18795813
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
 

Author Comment

by:ucfperson
ID: 18796227
Fixed it,   moved the pages from php4 to php5 and the database,   the passwds needed to be re encrypted.  
0

Featured Post

Free Tool: Site Down Detector

Helpful to verify reports of your own downtime, or to double check a downed website you are trying to access.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
Export Table to CSV - Access to CSV - using python 18 223
Advice in Xamarin 21 109
Difference between List and Array in Python 5 117
Ruby or Python 7 59
If you’re thinking to yourself “That description sounds a lot like two people doing the work that one could accomplish,” you’re not alone.
Today, the web development industry is booming, and many people consider it to be their vocation. The question you may be asking yourself is – how do I become a web developer?

733 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question