SitePoint Sponsor

User Tag List

Results 1 to 8 of 8
  1. #1
    SitePoint Zealot Run2Web's Avatar
    Join Date
    Apr 2002
    Location
    Indiana
    Posts
    165
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Angry Help Figuring out this error (Warning: Wrong parameter count for mysql_num_rows() )

    I keep getting this error. Currently this is my code for that line and a few above and below.

    PHP Code:
        //run the owners query 
        
    $result_owner mysql_query($query_owners);  
        
    //query Plots
        
    $query_plots "SELECT * From $plots ";
        
    $query_plots $query_plots"(and plot_details($thePlotID) LIKE '$thePlotID%') substr()";
        
    //run the plots query
        
    $result_plots =mysql_query($query_plots);
        
    $resultsmysql_num_rows($result_owner,$result_plots);
        
    $item0
    Can anyone help me understand the problem? I may need to show a lot more code. I am so frustrated. I have been working on this for 2 days now and not finding any solution. I have tried what feels like 100 different things.
    RUN2Web

    Has Anyone seen my Furry Little Mind?

  2. #2
    Mlle. Ledoyen silver trophy seanf's Avatar
    Join Date
    Jan 2001
    Location
    UK
    Posts
    7,168
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    PHP Code:
    $results mysql_num_rows $query_plots ); 
    Sean
    Harry Potter

    -- You lived inside my world so softly
    -- Protected only by the kindness of your nature

  3. #3
    SitePoint Zealot Run2Web's Avatar
    Join Date
    Apr 2002
    Location
    Indiana
    Posts
    165
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    I have two queries though.

    I am currently trying
    PHP Code:
    $resultsmysql_num_rows($result_owner);
    $results2mysql_num_rows($result_plots); 
    and then I have to try to get the if statement associated with it to do both.

    I replaced this:
    PHP Code:
     if($results 0)    
        {
          WHILE (
    $row=mysql_fetch_array($result_owner)) :  /* , $result_plots */
              
    $item++;        // add one to the item count
            // $row is the result that was gotten from the $query_owner
              // Print the relevant information 
            
    $ownerid $row['OwnerID'];
            
    $last $row['LastName'];
            
    $first $row['FirstName'];
            
    $city $row['City'];
            
    $state $row['State'];
            
    $zip $row['Zip'];
            
    $hidden $row['hidden'];    
            
    $plotid $row['$thePlotID'];
     
    // display the result with the same code used to make the form
            
    include 'report_admin_table_show.php';    
          ENDWHILE;
             }
        else    
    // no results
        

    with:
    PHP Code:
     if($results $results2 0)    
        {
          WHILE (
    $row=mysql_fetch_array($result_owner$result_plots)) :  /*  */
              
    $item++;        // add one to the item count
            // $row is the result that was gotten from the $query_owner
              // Print the relevant information 
            
    $ownerid $row['OwnerID'];
            
    $last $row['LastName'];
            
    $first $row['FirstName'];
            
    $city $row['City'];
            
    $state $row['State'];
            
    $zip $row['Zip'];
            
    $hidden $row['hidden'];    
            
    $plotid $row['$thePlotID'];
     
    // display the result with the same code used to make the form
            
    include 'report_admin_table_show.php';    
          ENDWHILE;
             }
        else    
    // no results
        

    and got this error:
    Warning: mysql_num_rows(): supplied argument is not a valid MySQL result resource in /home/hagerstown1/www/HagerstownCemetery/report_admin_html_nu.php on line 371

    Warning: mysql_num_rows(): supplied argument is not a valid MySQL result resource in /home/hagerstown1/www/HagerstownCemetery/report_admin_html_nu.php on line 372
    RUN2Web

    Has Anyone seen my Furry Little Mind?

  4. #4
    SitePoint Wizard johnn's Avatar
    Join Date
    Mar 2001
    Location
    Southern California, USA
    Posts
    1,181
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    This
    WHILE ($row=mysql_fetch_array($result_owner, $result_plots))


    seems unusual to me: 2 results in one call? Try separate it.

  5. #5
    SitePoint Zealot Run2Web's Avatar
    Join Date
    Apr 2002
    Location
    Indiana
    Posts
    165
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Would this work?

    PHP Code:
    WHILE ($row=mysql_fetch_array($result_owner) && ($result_plots)) : 
    RUN2Web

    Has Anyone seen my Furry Little Mind?

  6. #6
    SitePoint Wizard johnn's Avatar
    Join Date
    Mar 2001
    Location
    Southern California, USA
    Posts
    1,181
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Maybe not. I think the problem is how to lay out the logic. If you want to list owners and each owner has one or more plots:

    First, do a query to get results of list owners:
    then
    PHP Code:
    While fetching arrays of owners
    {
       echo 
    out owner's names and detail here
       do a query to get results of plots from this owner
       if num rows > 0 (that means rows of plots exist)
       {
           while fetching arrays of plot
           {
               echo out detail of each plots
           }
       }

    Last edited by johnn; Nov 8, 2002 at 14:39.

  7. #7
    SitePoint Zealot Run2Web's Avatar
    Join Date
    Apr 2002
    Location
    Indiana
    Posts
    165
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Question

    Like this?
    PHP Code:
       if($results 0)    
        {
          WHILE (
    $row=mysql_fetch_array($result_owner)) : 
          {
              
    $item++;        // add one to the item count
            // $row is the result that was gotten from the $query_owner
              // Print the relevant information 
            
    $ownerid $row['OwnerID'];
            
    $last $row['LastName'];
            
    $first $row['FirstName'];
            
    $city $row['City'];
            
    $state $row['State'];
            
    $zip $row['Zip'];
            
    $hidden $row['hidden'];
                if(
    $results2 0)
                {
                WHILE (
    $row=mysql_fetch_array($result_plots))
                
    $plotid $row['$thePlotID'];
                 }
    // display the result with the same code used to make the form
            
    include 'report_admin_table_show.php';    
          ENDWHILE;
                 ENDWHILE;
                 }
             }
        else    
    // no results
        

    I am really dumb today.
    Last edited by Run2Web; Nov 8, 2002 at 15:14.
    RUN2Web

    Has Anyone seen my Furry Little Mind?

  8. #8
    SitePoint Zealot Run2Web's Avatar
    Join Date
    Apr 2002
    Location
    Indiana
    Posts
    165
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Well I know that isn't my answer, my current errors are Parse error: parse error, unexpected T_ENDWHILE

    I commented out the ENDWHILE Statements and then it didn't like the Curly braces so I don't know where to go from here.
    RUN2Web

    Has Anyone seen my Furry Little Mind?


Bookmarks

Posting Permissions

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