Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 5 of 5
  1. #1
    New Coder
    Join Date
    Aug 2006
    Location
    Decatur Illinois
    Posts
    72
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Connection Problems?

    Here is my delimma the webpage should pull all of the information from the database and it does not show anything on the page. Not even the employee's name. Also dreamweaver doesnt recognize it its really annoying sheesh if anyone can help i will be happy(yes i know the connection is commented out)

    PHP Code:
    <?php
    //Connection statement
    //require_once('../../Connections/befh.php');

    // begin Recordset
    $colname__rs_employeeDetail '1';
    if (isset(
    $HTTP_GET_VARS['employeeID'])) {
      
    $colname__rs_employeeDetail $HTTP_GET_VARS['employeeID'];
    }
    $query_rs_employeeDetail sprintf("SELECT staffquestions.staffquestion, staffanswers.staffanswer FROM staffquestions, staffanswers WHERE staffanswers.employeeID = %s  AND staffanswers.staffquestionID = staffquestions.staffquestionID"$colname__rs_employeeDetail);
    $rs_employeeDetail $befh->SelectLimit($query_rs_employeeDetail) or die($befh->ErrorMsg());
    $totalRows_rs_employeeDetail $rs_employeeDetail->RecordCount();
    // end Recordset

    // begin Recordset
    $colname__rs_employeePhoto '-1';
    if (isset(
    $HTTP_GET_VARS['employeeID'])) {
      
    $colname__rs_employeePhoto $HTTP_GET_VARS['employeeID'];
    }
    $query_rs_employeePhoto sprintf("SELECT * FROM employees WHERE employeeID = %s"$colname__rs_employeePhoto);
    $rs_employeePhoto $befh->SelectLimit($query_rs_employeePhoto) or die($befh->ErrorMsg());
    $totalRows_rs_employeePhoto $rs_employeePhoto->RecordCount();
    // end Recordset

    $SSAdv_colors1 = array("RowOdd","RowEven");
    $SSAdv_k1 0;
    $SSAdv_m1 0;
    $SSAdv_change_every1 1;


    //PHP ADODB document - made with PHAkt 2.7.1
    ?>

  • #2
    New Coder
    Join Date
    Aug 2006
    Posts
    10
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Simplify..

    Hey, scale back your code (or make a new script) that *JUST* connects to the DB or errors out...that way you'll know if you're chasing a connection error or a code problem:

    Code:
    // add connection code
    
    $select = "select * from $database_table";
    
    $sqlresults = mysql_query($select);
    
    $row_count = mysql_num_rows($sqlresults);
    if ($row_count = = "0")
    {
    echo "No entries match criteria";
    }

  • #3
    New Coder
    Join Date
    Aug 2006
    Location
    Decatur Illinois
    Posts
    72
    Thanks
    0
    Thanked 0 Times in 0 Posts
    It now says

    Notice: Undefined variable: database_table in /u/internet/com/brintlinger-earl/includes/content/about_staff_detail.php on line 32

    Warning: mysql_num_rows(): supplied argument is not a valid MySQL result resource in /u/internet/com/brintlinger-earl/includes/content/about_staff_detail.php on line 36
    No entries match criteria


    WHat does that mean?

  • #4
    Senior Coder
    Join Date
    Sep 2005
    Posts
    1,791
    Thanks
    5
    Thanked 36 Times in 35 Posts
    it means you need to assign something sensibe to the variable $database_table, i.e. the name of one of your database tables

  • #5
    New Coder
    Join Date
    Aug 2006
    Posts
    10
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Uh...

    I'd start by setting the $database_table variable equal to whatever your table is named in the database...

    That should kill both errors with one definition.


  •  

    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts
    •