Generating reports, variable is undefined.

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • rendanime
    New Member
    • Jun 2007
    • 12

    Generating reports, variable is undefined.

    I need your help, i have designed a system using PHP. Now i want to create a report for projects. Currently the system can genarate report for all available project ( i manage to do this because is easy - just take everything in the table). What i want to do is to make a report for one project. I placed a print button in a project grid - when a user click that button, i want the system to automatically pick up the projectId for that current project.
    What i want is somthing like this: When you want the name of current user, you can do it like this:
    $user_id = $this->session->userdata('user id');

    So now i have things like this:
    $project_detail s = $this->projectmodel->retrieve_by_pk ey($idField);
    How do i pick up $idField automatically?? ?? $idField =??????

    Will appriceate your help
  • pbmods
    Recognized Expert Expert
    • Apr 2007
    • 5821

    #2
    Heya, rendanime.

    What do you want your code to do? Give an example.
    What is your code doing that you don't want it to do? Give an example.
    What is your code *not* doing that it is supposed to? Give an example.

    Comment

    • rendanime
      New Member
      • Jun 2007
      • 12

      #3
      Originally posted by pbmods
      Heya, rendanime.

      What do you want your code to do? Give an example.
      What is your code doing that you don't want it to do? Give an example.
      What is your code *not* doing that it is supposed to? Give an example.
      Hi pbmods, Thanx : when the program executes the following code:
      $project_detail s = $this->projectmodel->retrieve_by_pk ey($idField);
      I want it to pass $idField to a function called "retrieve_by_ke y($idFiled)" . So my problem is how is it going to pass it or rather how is it going to pick it up for that particular project???

      Comment

      • kovik
        Recognized Expert Top Contributor
        • Jun 2007
        • 1044

        #4
        What? You have full access to the $idField variable because you had to have the variable in order to pass it as a function parameter.

        What is it that you are after?

        Comment

        • rendanime
          New Member
          • Jun 2007
          • 12

          #5
          Originally posted by volectricity
          What? You have full access to the $idField variable because you had to have the variable in order to pass it as a function parameter.

          What is it that you are after?
          Hi, look, if i want to retrieve informatiion using userID, i can something like this:
          $user_id = $this->session->userdata('user id'); //This will pick-up the userID for that current session autiomatically (i.e without saying $userID=5).
          $project_detail s = $this->projectmodel->retrieve_by_pk ey($userID);

          So now i have things like this:
          $idField =?????; // here is the problem
          $project_detail s = $this->projectmodel->retrieve_by_pk ey($idField);
          //I want the system to pick up $idField for the project that i have open (current project).

          Comment

          Working...