Solved

php4 array worked, now with 5 it doesnt.

Posted on 2007-03-24
4
206 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
[X]
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
  • 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

Transaction Monitoring Vs. Real User Monitoring

Synthetic Transaction Monitoring Vs. Real User Monitoring: When To Use Each Approach? In this article, we will discuss two major monitoring approaches: Synthetic Transaction and Real User Monitoring.

Question has a verified solution.

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

Whether you’re a college noob or a soon-to-be pro, these tips are sure to help you in your journey to becoming a programming ninja and stand out from the crowd.
In this post we will learn different types of Android Layout and some basics of an Android App.
In this seventh video of the Xpdf series, we discuss and demonstrate the PDFfonts utility, which lists all the fonts used in a PDF file. It does this via a command line interface, making it suitable for use in programs, scripts, batch files — any pl…
Six Sigma Control Plans

696 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