Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people, just like you, are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
Solved

php4 array worked, now with 5 it doesnt.

Posted on 2007-03-24
4
200 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: Port Scanner

Check which ports are open to the outside world. Helps make sure that your firewall rules are working as intended.

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
How to get all the API from website? 11 104
Query Syntax 17 43
Query group by data in SQL Server - cursor? 3 47
Output in PHP throwing alignment of data off issue 12 43
This is about my first experience with programming Arduino.
In this post we will learn how to connect and configure Android Device (Smartphone etc.) with Android Studio. After that we will run a simple Hello World Program.

856 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