Page 1 of 5 123 ... Last
  • Jump to page:
    #1
  1. No Profile Picture
    Contributing User
    Devshed Novice (500 - 999 posts)

    Join Date
    Jan 2017
    Posts
    845
    Rep Power
    0

    Converting Pagination Procedural Style Code To PREP STMT


    Folks,

    Do have a look at my pagination code using procedural style that is working fine:

    PHP Code:
    <?php 

    //Required PHP Files. 
    include 'config.php'
    include 
    'header.php'

    //Check if User is already logged-in or not. Get the login_check() FUNCTION to check. 
    if (login_check() === FALSE
    {
        
    //Redirect User to Log-in Page after 2 secs. 
        
    header("refresh:2; url=login.php"); 
        exit(); 

    else 

        
    $user $_SESSION["user"]; 
        
        
    $id $_SESSION["id"]; 
        
    $account_activation_status $_SESSION["account_activation_status"]; 
        
    $id_video_verification_status $_SESSION["id_video_verification_status"]; 
        
    $id_video_verification_url $_SESSION["id_video_verification_url"]; 
        
    $sponsor_username $_SESSION["sponsor_username"]; 
        
    $recruits_number $_SESSION["recruits_number"]; 
        
    $on_day_number_on_7_days_wish_list $_SESSION["on_day_number_on_7_days_wish_list"]; 
        
    $primary_website_domain $_SESSION["primary_website_domain"]; 
        
    $primary_website_email $_SESSION["primary_website_email"]; 
        
    $username $_SESSION["username"]; 
        
    $first_name $_SESSION["first_name"]; 
        
    $middle_name $_SESSION["middle_name"]; 
        
    $surname $_SESSION["surname"]; 
        
    $gender $_SESSION["gender"]; 
        
    $age_range $_SESSION["age_range"]; 
        
    $religion $_SESSION["religion"]; 
        
    $marital_status $_SESSION["marital_status"]; 
        
    $working_status $_SESSION["working_status"]; 
        
    $profession $_SESSION["profession"]; 
        
        
    $recipient_username $user;

        
    ?> 
        <!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional/EN"> 
        <html> 
        <head> 
          <meta content="text/html; charset=ISO-8859-1"  http-equiv="content-type"> 
        <title><?php $user ?>Notices in <?php $server_time ?> time.</title>
        </head> 
        <body> 
        <br> 
        <center><span style="font-weight: bold;"><?php $user ?>Notices in <?php $server_time ?> time.</span></center> 
        <br> 
        <br> 
        
    <?php 
        
    if (!$conn)
    {
        
    $error mysqli_connect_error();
        
    $errno mysqli_connect_errno();
        print 
    "$errno$error\n";
        exit();
    }

        
    $query "SELECT * FROM notices";
        
    $result mysqli_query($conn,$query); 
        
    $rows_num mysqli_num_rows($result);
        
        
    //Total number of pages records are spread-over 
        
    $page_count 10
        
    $page_size ceil($rows_num $page_count); 
        
    //Get the Page Number, Default is 1 (First Page) 
        
    $page_number $_GET["page_number"]; 
        if (
    $page_number == ""$page_number 1
            
    $offset = ($page_number -1) * $page_size
            
            
    $query .= " limit {$offset},{$page_size}"
            
    $result mysqli_query($conn,$query); 
        
    ?> 
        <table width="1500" border="0" cellpadding="5" cellspacing="2" bgcolor="#666666"> 
        <?php if($rows_num) {?> 
        <tr name="headings"> 
        <td bgcolor="#FFFFFF" name="column-heading_submission-number">Submission Number</td> 
        <td bgcolor="#FFFFFF" name="column-heading_logging-server-date-&-time">Date & Time in <?php $server_time ?></td> 
        <td bgcolor="#FFFFFF" name="column-heading_username">To</td> 
        <td bgcolor="#FFFFFF" name="column-heading_gender">From</td> 
        <td bgcolor="#FFFFFF" name="column-heading_age-range">Notice</td> 
        </tr> 
        <?php while($row mysqli_fetch_array($result)){ ?> 
        <tr name="user-details"> 
        <td bgcolor="#FFFFFF" name="submission-number"><?php echo $row['id']; ?></td> 
        <td bgcolor="#FFFFFF" name="logging-server-date-&-time"><?php echo $row['date_and_time']; ?></td> 
        <td bgcolor="#FFFFFF" name="username"><?php echo $row['recipient_username']; ?></td> 
        <td bgcolor="#FFFFFF" name="gender"><?php echo $row['sender_username']; ?></td> 
        <td bgcolor="#FFFFFF" name="age-range"><?php echo $row['message']; ?></td> 
        </tr> 
        <?php ?> 
        <tr name="pagination"> 
        <td colspan="10" bgcolor="#FFFFFF"> Result Pages: 
        <?php 
            
    if($rows_num <= $page_size
            { 
                echo 
    "Page 1";  
            } 
            else 
            { 
                for(
    $i=1;$i<=$page_count;$i++) 
                echo 
    "<a href=\"{$_SERVER['PHP_SELF']}?page_number={$i}\">{$i}</a>  "
            }     
            
    ?>     
        </td> 
        </tr> 
        <?php } else { ?> 
        <tr> 
        <td bgcolor="FFFFFF">No record found! Try another time.</td> 
        </tr> 
        <?php }?> 
        </table> 
        <br> 
        <br> 
        <center><span style="font-weight: bold;"><?php $user ?>Notices in <?php $server_time ?> time.</span></center> 
        <br> 
        <br> 
    </div> 
    <br> 
    </body> 
    </html> 
    <?php 
    }
    ?>
    Now, to prevent sql injection, need to use PREP STMT. I need your help.
    I got upto this far where I get an error:

    Fatal error: Uncaught mysqli_sql_exception: Commands out of sync; you can't run this command now in C:\xampp\htdocs\test\notices.php:86 Stack trace: #0 C:\xampp\htdocs\test\notices.php(86): mysqli_query(Object(mysqli), 'SELECT id,date_...') #1 {main} thrown in C:\xampp\htdocs\test\notices.php on line 86

    Line 86 looks like this:
    PHP Code:
    $result mysqli_query($conn,$query); 
    I have put a comment on line 86 on the full code below ....
    Here is the full code of my attempt. Do check it out on your wampp/xampp and see what I should change line 86 to:
    PHP Code:
    <?php 

    //Required PHP Files. 
    include 'config.php'
    include 
    'header.php'

    //Check if User is already logged-in or not. Get the login_check() FUNCTION to check. 
    if (login_check() === FALSE
    {
        
    //Redirect User to Log-in Page after 2 secs. 
        
    header("refresh:2; url=login.php"); 
        exit(); 

    else 

        
    $user $_SESSION["user"]; 
        
        
    $id $_SESSION["id"]; 
        
    $account_activation_status $_SESSION["account_activation_status"]; 
        
    $id_video_verification_status $_SESSION["id_video_verification_status"]; 
        
    $id_video_verification_url $_SESSION["id_video_verification_url"]; 
        
    $sponsor_username $_SESSION["sponsor_username"]; 
        
    $recruits_number $_SESSION["recruits_number"]; 
        
    $on_day_number_on_7_days_wish_list $_SESSION["on_day_number_on_7_days_wish_list"]; 
        
    $primary_website_domain $_SESSION["primary_website_domain"]; 
        
    $primary_website_email $_SESSION["primary_website_email"]; 
        
    $username $_SESSION["username"]; 
        
    $first_name $_SESSION["first_name"]; 
        
    $middle_name $_SESSION["middle_name"]; 
        
    $surname $_SESSION["surname"]; 
        
    $gender $_SESSION["gender"]; 
        
    $age_range $_SESSION["age_range"]; 
        
    $religion $_SESSION["religion"]; 
        
    $marital_status $_SESSION["marital_status"]; 
        
    $working_status $_SESSION["working_status"]; 
        
    $profession $_SESSION["profession"]; 
        
        
    $recipient_username $user;

        
    ?> 
        <!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional/EN"> 
        <html> 
        <head> 
          <meta content="text/html; charset=ISO-8859-1"  http-equiv="content-type"> 
        <title><?php $user ?>Notices in <?php $server_time ?> time.</title>
        </head> 
        <body> 
        <br> 
        <center><span style="font-weight: bold;"><?php $user ?>Notices in <?php $server_time ?> time.</span></center> 
        <br> 
        <br> 
        
    <?php 
        
    if (!$conn)
    {
        
    $error mysqli_connect_error();
        
    $errno mysqli_connect_errno();
        print 
    "$errno$error\n";
        exit();
    }

    $query "SELECT id,date_and_time,recipient_username,sender_username,message FROM notices WHERE recipient_username = ?";

    if (
    $stmt mysqli_prepare($conn$query)) {

        
    /* bind param */
        
    mysqli_stmt_bind_param($stmt,'s',$recipient_username);
        
        
    /* execute statement */
        
    mysqli_stmt_execute($stmt);    

        
    /* bind result variables */
        
    $result mysqli_stmt_bind_result($stmt,$id,$date_and_time,$recipient_username,$sender_username,$message);

        
    $rows_num mysqli_stmt_num_rows($stmt);
        
        
    //Total number of pages records are spread-over 
        
    $page_count 10
        
    $page_size ceil($rows_num $page_count); 
        
    //Get the Page Number, Default is 1 (First Page) 
        
    $page_number $_GET["page_number"]; 
        if (
    $page_number == ""$page_number 1
            
    $offset = ($page_number -1) * $page_size
            
            
    $query .= " limit {$offset},{$page_size}"
            
    $result mysqli_query($conn,$query); //THIS IS LINE 86 WHERE THE ERROR OCCURS. WHAT TO CHANGE THIS LINE TO ?
        
    ?> 
        <table width="1500" border="0" cellpadding="5" cellspacing="2" bgcolor="#666666"> 
        <?php if($rows_num) {?> 
        <tr name="headings"> 
        <td bgcolor="#FFFFFF" name="column-heading_submission-number">Submission Number</td> 
        <td bgcolor="#FFFFFF" name="column-heading_logging-server-date-&-time">Date & Time in <?php $server_time ?></td> 
        <td bgcolor="#FFFFFF" name="column-heading_username">To</td> 
        <td bgcolor="#FFFFFF" name="column-heading_gender">From</td> 
        <td bgcolor="#FFFFFF" name="column-heading_age-range">Notice</td> 
        </tr> 
        <?php while($row mysqli_fetch_array($result)){ ?> 
        <tr name="user-details"> 
        <td bgcolor="#FFFFFF" name="submission-number"><?php echo $row['id']; ?></td> 
        <td bgcolor="#FFFFFF" name="logging-server-date-&-time"><?php echo $row['date_and_time']; ?></td> 
        <td bgcolor="#FFFFFF" name="username"><?php echo $row['recipient_username']; ?></td> 
        <td bgcolor="#FFFFFF" name="gender"><?php echo $row['sender_username']; ?></td> 
        <td bgcolor="#FFFFFF" name="age-range"><?php echo $row['message']; ?></td> 
        </tr> 
        <?php ?> 
        <tr name="pagination"> 
        <td colspan="10" bgcolor="#FFFFFF"> Result Pages: 
        <?php 
            
    if($rows_num <= $page_size
            { 
                echo 
    "Page 1";  
            } 
            else 
            { 
                for(
    $i=1;$i<=$page_count;$i++) 
                echo 
    "<a href=\"{$_SERVER['PHP_SELF']}?page_number={$i}\">{$i}</a>  "
            }     
            
    ?>     
        </td> 
        </tr> 
        <?php } else { ?> 
        <tr> 
        <td bgcolor="FFFFFF">No record found! Try another time.</td> 
        </tr> 
        <?php }?> 
        </table> 
        <br> 
        <br> 
        <center><span style="font-weight: bold;"><?php $user ?>Notices in <?php $server_time ?> time.</span></center> 
        <br> 
        <br> 
    </div> 
    <br> 
    </body> 
    </html> 
    <?php 
        
    /* close statement */
        
    mysqli_stmt_close($stmt);
    }

    /* close connection */
    mysqli_close($conn);

    }
    ?>
    Last edited by UniqueIdeaMan; February 24th, 2018 at 09:54 AM.
  2. #2
  3. No Profile Picture
    Contributing User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Aug 2016
    Posts
    141
    Rep Power
    66
    is working fine:
    Are you sure about that? The $page_size variable being used in the LIMIT clause in the query is the wrong variable. It should be the $page_count variable.

    If you name your variables better, you can avoid this type of mistake. The $page_count variable is actually the number of rows/records per page and the $page_size variable is the total number of pages. Neither of these variables are named anything to do with what they are being used for.

    Your limit clause is currently trying to do - LIMIT offset, total number of pages. Does that make any sense? Shouldn't it be - LIMIT offset, number of rows per page?

    As to the error, you can do a web search for that error message and find what it means. Short-version - you have not fetched all the result(s) from one query before trying to run another query.

    If you re-read my reply outlining what the two sql queries need to be, you will find that the first query should be using COUNT(*) to get a count of matching rows, not by selecting all the matching rows. If you use COUNT(*) to do this, there will only be a single row in the result set and once you fetch that, this error will go-a-way.
  4. #3
  5. No Profile Picture
    Contributing User
    Devshed Novice (500 - 999 posts)

    Join Date
    Jan 2017
    Posts
    845
    Rep Power
    0
    Originally Posted by DSmabismad
    Are you sure about that? The $page_size variable being used in the LIMIT clause in the query is the wrong variable. It should be the $page_count variable.

    If you name your variables better, you can avoid this type of mistake. The $page_count variable is actually the number of rows/records per page and the $page_size variable is the total number of pages. Neither of these variables are named anything to do with what they are being used for.

    Your limit clause is currently trying to do - LIMIT offset, total number of pages. Does that make any sense? Shouldn't it be - LIMIT offset, number of rows per page?

    As to the error, you can do a web search for that error message and find what it means. Short-version - you have not fetched all the result(s) from one query before trying to run another query.

    If you re-read my reply outlining what the two sql queries need to be, you will find that the first query should be using COUNT(*) to get a count of matching rows, not by selecting all the matching rows. If you use COUNT(*) to do this, there will only be a single row in the result set and once you fetch that, this error will go-a-way.
    Thanks! The non PREP STMT version that I said was working, is not actually my code. I found it somewhere online. Made use of it for over a year on other projects.
    I think the way that script was coded is that, programmer picks how many pages he want all records spread-over. In my case 10 pages. And then the script checks how many rows of records there are and spreads it over 10 pages. And so, the row count on each page are likely to differ on each search. Some searches will yield, for example, 10 records per page while other kw searches display different number of records per page.
    As of right now, I don't care whether 10 records is displayed per page or 100 records as I can always change the values of variables now and then. I just want to convert the script to PREP STMT. Saying all this, if you deem there is an error in the non-PREP STMT version (which I picked from somewhere) then you have done good in pointing-out the errors to me. Cheers for that!

    On the current project, tried making use of it and it does working. Maybe co-incidently. But, since my whole project revolves around PREP STMT then must convert this page's code to it too.

    EDIT: I thought the original programmer was using the $rows_num = mysqli_stmt_num_rows($stmt) to count the rows fetched. What do you think ?
    On line 73, the following shows no pagination numbers:
    PHP Code:
    //$result = mysqli_stmt_bind_result($stmt,$id,$date_and_time,$recipient_username,$sender_username,$message); 
    But, if I switch the above to:
    PHP Code:
    $result mysqli_stmt_store_result($stmt); 
    Then, I see the pagination, even though I see a new error:
    Warning: mysqli_fetch_array() expects parameter 1 to be mysqli_result, boolean given in C:\xampp\htdocs\test\notices.php on line 99
    I'm guessing I getting the error because no results were fetched.
    Last edited by UniqueIdeaMan; February 25th, 2018 at 05:05 AM.
  6. #4
  7. No Profile Picture
    Contributing User
    Devshed Novice (500 - 999 posts)

    Join Date
    Jan 2017
    Posts
    845
    Rep Power
    0
    DSmabismad,

    Anyway, saying all this, I would like to see the following from you IN ORDER to LEARN your STYLE of doing things.
    And so, if you don't mind, may we see 6 samples (if it's not too much to ask):

    1. A code sample where each page shows only 10 records. (Use NON-PREP STMT).
    2. A code sample where all records are spreadover 10 pages. (Use NON-PREP STMT).

    3. A code sample where each page shows only 10 records. (Use PREP STMT - mysqli procedural style).
    4. A code sample where all records are spreadover 10 pages. (Use PREP STMT - mysqli - procedural style).


    5. A code sample where each page shows only 10 records. (Use PREP STMT - PDO oop style).
    6. A code sample where all records are spreadover 10 pages. (Use PREP STMT - PDO oop style).

    Or, if that was too much to ask, then how-about 2 samples (bold ones mentioned obove). And, if that is too much too then how-about 1 sample from your end (the bold red one) ?
    I'm pretty much sure other future newbies would appreciate your hard work. Alternatively, open a separate tutorial thread on the subject and show your code samples there. And then mention the link on this thread for me to check it out.
    I'll wait for your sample. Thanks.
    As for me, this is the 3rd day I'm gonna google for a proper tutorial on this subject. All tutorials found so far do not show PREP STMT sample and the ones that do show don't show it procedural style. I have not got into oop style yet and not a good idea to jump into it half-way through the procedural style.

    PS - Don't worry. Other gurus are likely to chime in on the samples and so best you make the first move since I asked you to. I'll try charming the others. Benanamen loves pdo. I'll see if I can put him upto doing the pdo versions. He's helped me out once with a pdo sample.

    Cheers!

    Comments on this post

    • benanamen agrees : I couldn't have said it better.
    Last edited by UniqueIdeaMan; February 25th, 2018 at 04:26 AM.
  8. #5
  9. No Profile Picture
    Contributing User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Aug 2016
    Posts
    141
    Rep Power
    66
    There are already 10's of thousands of examples posted on the web for each of the things you are doing. Someone posting one more isn't going to help you or anyone else, if you are not able to read, understand, and get the processing being used in the examples, so that you can then apply that same processing to your specific data.

    You are stuck on copying things you see posted elsewhere on the web, and continue to ignore specific things we have taken the time to write out in replies. Why is that?

    Go find an example on the web of pagination code that is using a query that looks like - SELECT COUNT(*) AS total_rows FROM some_table WHERE some_where condition here, execute that query, and fetch the total_rows value from that query.
  10. #6
  11. No Profile Picture
    Contributing User
    Devshed Novice (500 - 999 posts)

    Join Date
    Jan 2017
    Posts
    845
    Rep Power
    0
    Originally Posted by DSmabismad
    There are already 10's of thousands of examples posted on the web for each of the things you are doing. Someone posting one more isn't going to help you or anyone else, if you are not able to read, understand, and get the processing being used in the examples, so that you can then apply that same processing to your specific data.

    You are stuck on copying things you see posted elsewhere on the web, and continue to ignore specific things we have taken the time to write out in replies. Why is that?

    Go find an example on the web of pagination code that is using a query that looks like - SELECT COUNT(*) AS total_rows FROM some_table WHERE some_where condition here, execute that query, and fetch the total_rows value from that query.
    Cheers for suggesting KWs because my ones were failing to provide links with proper samples.
  12. #7
  13. No Profile Picture
    Contributing User
    Devshed Novice (500 - 999 posts)

    Join Date
    Jan 2017
    Posts
    845
    Rep Power
    0
    Folks,

    What is wrong with my line 70 or 60 ?

    PHP Code:
    <?php 

    //Required PHP Files. 
    include 'config.php'
    include 
    'header.php'

    //Check if User is already logged-in or not. Get the login_check() FUNCTION to check. 
    if (login_check() === FALSE

        
    //Redirect User to Log-in Page after 2 secs. 
        
    header("refresh:2; url=login.php"); 
        exit(); 

    else 

        
    //Grab User details from Session Variables and echo them. 
        
    $user $_SESSION["user"]; 
        
        
    $id $_SESSION["id"]; 
        
    $account_activation_status $_SESSION["account_activation_status"]; 
        
    $id_video_verification_status $_SESSION["id_video_verification_status"]; 
        
    $id_video_verification_url $_SESSION["id_video_verification_url"]; 
        
    $sponsor_username $_SESSION["sponsor_username"]; 
        
    $recruits_number $_SESSION["recruits_number"]; 
        
    $on_day_number_on_7_days_wish_list $_SESSION["on_day_number_on_7_days_wish_list"]; 
        
    $primary_website_domain $_SESSION["primary_website_domain"]; 
        
    $primary_website_email $_SESSION["primary_website_email"]; 
        
    $username $_SESSION["username"]; 
        
    $first_name $_SESSION["first_name"]; 
        
    $middle_name $_SESSION["middle_name"]; 
        
    $surname $_SESSION["surname"]; 
        
    $gender $_SESSION["gender"]; 
        
    $date_of_birth $_SESSION["date_of_birth"]; 
        
    $age_range $_SESSION["age_range"]; 
        
    $religion $_SESSION["religion"]; 
        
    $marital_status $_SESSION["marital_status"]; 
        
    $working_status $_SESSION["working_status"]; 
        
    $profession $_SESSION["profession"]; 
        
    $home_town $_SESSION["home_town"]; 
        
    $home_borough $_SESSION["home_borough"]; 
        
    $home_city $_SESSION["home_city"]; 
        
    $home_county $_SESSION["home_county"]; 
        
    $home_region $_SESSION["home_region"]; 
        
    $home_state $_SESSION["home_state"]; 
        
    $home_country $_SESSION["home_country"]; 
        
        
    $recipient_username $user
        
    ?> 
        <!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional/EN"> 
        <html> 
        <head> 
        <meta content="text/html; charset=ISO-8859-1"  http-equiv="content-type"> 
        <title><?php echo "$site_name $user"?> User's Notices in <?php echo $server_time?> time.</title> 
        </head> 
        <body> 
        <br> 
        <center><span style="font-weight: bold;"><?php echo "$site_name $user"?> User's Notices in <?php echo $server_time?> time.</span></center> 
        <br> 
        <br> 

    <?php 
    // Get inital params
    if (isset($_GET['page'])) { $page $_GET['page']; } else { $page 1; }
    $max_results 100;
    $offset $page*$max_results $max_results;
    // This is the maximium amount of pages to display before adding Prev \ Next
    $max 10;

    $sql "SELECT COUNT(*) AS COUNT WHERE recipient_username = ?";
    $stmt $conn->prepare($sql);
    $stmt->bind_param('s'$recipient_username);
    $stmt->execute();
    $stmt->bind_result($z);
    while (
    $stmt->fetch()) {
        
    $records $z;
    }
    $stmt->close();

    function 
    get_paging_info($count$offset$curr_page)
    {
        
    $pages ceil($count $offset);

        
    $data = array();
        
    $data['si']        = ($curr_page $offset) - $offset;
        
    $data['pages']     = $pages;
        
    $data['curr_page'] = $curr_page;

        return 
    $data//return the paging data

    }

    $paging_info get_paging_info($records$max_results$page);

    $html "";

    if(
    $paging_info['curr_page'] > 1) {

            
    $html $html "<a href='1' title='Page 1'>First</a> <a href='" . ($paging_info['curr_page'] - 1) . "' title='Page " . ($paging_info['curr_page'] - 1) . "'>Prev</a>";

    }

    if(
    $paging_info['curr_page'] < $max) {
        
    $sp 1;
    } else {
        if(
    $paging_info['curr_page'] >= ($paging_info['pages'] - floor($max 2)) ) {
            
    $sp $paging_info['pages'] - $max 1;
        } else {
            if(
    $paging_info['curr_page'] >= $max) {
                
    $sp $paging_info['curr_page']  - floor($max/2);
            }
        }
    }

    if(
    $paging_info['curr_page'] >= $max) {
        
    $html $html "<a href='1' title='Page 1'> 1</a> ... ";
    }

    for(
    $i $sp$i <= ($sp $max -1);$i++) {
        if(
    $i $paging_info['pages']) { continue; }

        if(
    $paging_info['curr_page'] == $i) {
            
    $html $html "<span class='bold'> {$i}</span>";
        } else {
            
    $html $html "<a href='{$i}' title='Page {$i}'> {$i}</a>";
        }
    }

    if(
    $paging_info['curr_page'] < ($paging_info['pages'] - floor($max 2)) && ($paging_info['pages'] > ($sp $max -1))) {
        
    $html $html " ... <a href='{$paging_info['pages']}' title='Page {$paging_info['pages']}'>{$paging_info['pages']}</a>";
    }
    if(
    $paging_info['curr_page'] < $paging_info['pages']) {
        
    $html $html " <a href='" . ($paging_info['curr_page'] + 1) . "' title='Page " . ($paging_info['curr_page'] + 1) . "'>Next</a><a href='{$paging_info['pages']}' title='Page {$paging_info['pages']}'> Last</a>";
    }

    echo 
    $html;

    $sql "SELECT id,date_and_time,recipient_username,sender_username,notice 
    FROM notices WHERE recipient_username = ? LIMIT ? OFFSET ?"
    ;
    $stmt $conn->prepare($sql);
    $stmt->bind_param('s'$recipient_username$max_results$offset);
    $stmt->execute();
    $stmt->bind_result($id$date$usernamesendername$notice);
    while (
    $stmt->fetch()) {
        
    // Your Code
    }
    $stmt->close();
    }
    ?>
    Line 69 & 70:
    PHP Code:
    $sql "SELECT COUNT(*) AS COUNT WHERE recipient_username = ?";
    $stmt $conn->prepare($sql); 
    I get error:
    Fatal error: Uncaught mysqli_sql_exception: You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near 'ROWS WHERE recipient_username = ?' at line 1 in C:\xampp\htdocs\test\notices_2.php:70 Stack trace: #0 C:\xampp\htdocs\test\notices_2.php(70): mysqli->prepare('SELECT COUNT(*)...') #1 {main} thrown in C:\xampp\htdocs\test\notices_2.php on line 70


    Cheers
  14. #8
  15. No Profile Picture
    Contributing User
    Devshed Novice (500 - 999 posts)

    Join Date
    Jan 2017
    Posts
    845
    Rep Power
    0
    I changed:

    PHP Code:
    $sql "SELECT COUNT(*) AS COUNT WHERE recipient_username = ?"
    to:
    PHP Code:
    $sql "SELECT COUNT(*) from notices WHERE recipient_username = ?"
    And error gone. But, error gone coincidently or I got it right ?
    Was the former line in error ? I got that from an expert programmer. The code from my previous post is from him (StackOverFlow) trying to help me out. I guess he made a typo or I understood him wrong.
    What you say ?
    Last edited by UniqueIdeaMan; March 11th, 2018 at 06:03 AM.
  16. #9
  17. No Profile Picture
    Contributing User
    Devshed Novice (500 - 999 posts)

    Join Date
    Jan 2017
    Posts
    845
    Rep Power
    0
    Can anyone provide a better pagination code ?
    Last edited by UniqueIdeaMan; March 11th, 2018 at 06:11 AM.
  18. #10
  19. No Profile Picture
    Contributing User
    Devshed Specialist (4000 - 4499 posts)

    Join Date
    Jul 2003
    Posts
    4,466
    Rep Power
    653
    Yes, on the Hire a Programmer forum.
    There are 10 kinds of people in the world. Those that understand binary and those that don't.
  20. #11
  21. Banned (not really)
    Devshed Supreme Being (6500+ posts)

    Join Date
    Dec 1999
    Location
    Caro, Michigan
    Posts
    14,950
    Rep Power
    4554
    You're not sure if adding "from <table>" to your SQL query _coincidentially_ removed the error? lol....

    13 months at this.... lol....
    -- Cigars, whiskey and wild, wild women. --
  22. #12
  23. No Profile Picture
    Contributing User
    Devshed Novice (500 - 999 posts)

    Join Date
    Jan 2017
    Posts
    845
    Rep Power
    0
    Originally Posted by Sepodati
    You're not sure if adding "from <table>" to your SQL query _coincidentially_ removed the error? lol....

    13 months at this.... lol....
    13 months ago, I re-started the php basics. You know:

    * syntax
    * strings
    * variables
    * echoes
    * single quotes
    * double quotes
    * the 3 loop types
    * Methods ($_GET & $_POST)
    * What are extensions (mysql, mysqli) and learnt which are deprecated ones and which are new ones
    * What layout is oop style and what procedural
    * what is pdo and how it differs from predecessors and which ones are predecessors
    * Prep Stmts
    * how to build member site (reg, login, home, logout, sessions, cookies, etc.).
    * etc.

    So, I guess you underestimated me too much. But yes, I agree my learning curve too slow.
    I did not fix anything to do with html <table> to rid the error. I just did what I mentioned on post 8 and the error vanished. But, I guess you are giving me another hint. Must look into it.
    Keep up your hints. I'm enjoying them. Riddles.

    @requinix, let them criticize me a little aslong as they don't do name calling. Don't close my threads unless I close them. Sometimes a donkey kick at the rear does bring you to your senses and everyone now and then needs a little criticism or life gets boring. I'm starting to like Sepodati.
    I could do with some donkey teeth marks on my backside from Mr Sepodati, Gw1500se and DSismad (or whatever his Username is) now and then. Lol!

    EDIT: I thought one of you guys would give me a procedural style mysqli pagination code with PREP STMT so I can learn from it and move-onto pdo ASAP. I got to keep that promise I made Benanamen. I'm still waiting. I need one with comments so I, aswell newbies to this thread, can learn from it.
    I'm afraid I'm gonna have to become a HelpVampire here when it comes to learning. But, when it comes to working then I don't like bothering anyone. But, got to learn first then work. That php manual is no good for learning pagination procedural style using PREP STMT. I did search. If any of you know a good link then that would be counted as a help.
    Damn pagination is becoming a real drag now. Or, maybe Requinix can help me here with the right tutorial link for pagination procedural style using mysqli and PREP STMT ?
    Google yielded no results for my keywords and been trying for half a wk atleast!

    Cheers!
    Last edited by UniqueIdeaMan; March 11th, 2018 at 10:05 AM.
  24. #13
  25. No Profile Picture
    Contributing User
    Devshed Novice (500 - 999 posts)

    Join Date
    Jan 2017
    Posts
    845
    Rep Power
    0
    Folks,

    Do you remember I grabbed pagination code from somewhere and asked for help here to add PREP STMT ?
    Well, I managed to add it.
    On the original code that I got from somewhere, on each page you saw pagination numbers in serial order like this:

    Page 123456

    Now, when you went to the final page. You saw the pages numbered NOT in reverse order like this:

    654321

    But, on my PREP STMT version, I added this feature.
    On the original code, the pagination code was looking very complicated and puzzling to me like this:

    PHP Code:
    <?php 
        
    //Connect to Mysql Server. 

        //Get Data from Table "browsing_histories". 
        
    $sql "SELECT * FROM browsing_histories"
        
    $result mysqli_query($conn,$sql); 
        
    //Total Number of Records 
        
    $rows_num mysqli_num_rows($result); 
        
    //Total Number of Pages Records to spread-over. 
        
    $page_count 10
        
    $page_size ceil($rows_num $page_count); 
        
    //Get the Page Number, Default is 1 (First Page). 
        
    $page_number $_GET["page_number"]; 
        if (
    $page_number == ""$page_number 1
            
    $offset = ($page_number -1) * $page_size
            
            
    $sql .= " limit {$offset},{$page_size}"
            
    $result mysqli_query($conn,$sql); 
        
    ?>
    Now all that offset stuff was doing my head in.
    And, I did not understand why the $query was getting concatenated. Like so:
    PHP Code:
    $sql .= " limit {$offset},{$page_size}"
    Quite frankly, I did not have a clue about that line of code. And for the last few days, it's been making me angry.
    And so, last night, I decided that, this original pagination code (without the PREP STMT) was way out of a beginner's league. And so, today I decided to write my own code with my own structure. A beginner's coding. Coding the pagination as much as I can in a simplified way.
    And so, I simplified it like this:
    PHP Code:
    <tr name="pagination"> 
                <td colspan="10" bgcolor="#FFFFFF"> Result Pages: 
                <?php 
                
                $rows_num 
    mysqli_stmt_num_rows($stmt); 
                
                if(
    $page_number $total_pages
                { 
                    for(
    $i=1;$i<=$total_pages;$i++) //Show Page Numbers in Serial Order. Eg. 1,2,3.
                    
    echo "<a href=\"{$_SERVER['PHP_SELF']}?page_number={$i}\">{$i}</a>  ";             
                } 
                else 
                { 
                    for(
    $i=$total_pages;$i>=1;$i--) //Show Page Numbers in Reverse Order. Eg. 3,2,1.
                    
    echo "<a href=\"{$_SERVER['PHP_SELF']}?page_number={$i}\">{$i}</a>  ";    
                } 
                
                
    ?> 
                </td> 
                </tr> 
                <?php
    Do you see any silly offsetting or $query concatenation in my code ? No!
    Plus, on the final paginationed page, you now see pages numbered in reverse order like so:
    Page 654321.

    And so, you got to admit that, my code is simpler and better for the site visitor.
    Maybe, the top searchengines should copy my idea ? I did say that, one day, I will defeat these monopolies with my simplifications. This is the beginning. keep on watching where the rabbit hole leads you. Hold your breath.
    But, before you do that, care to tell me why on EARTH my code is failing to display the row results ?

    Here's the full original code (non-PREP STMT) I grabbed from somewhere and edited column names etc. added sessions etc. to suit my purpose. See, how complicated it is for a beginner:
    PHP Code:
    <?php 

    //Required PHP Files. 
    include 'config.php'
    include 
    'header.php'

    //Check if User is already logged-in or not. Get the login_check() FUNCTION to check. 
    if (login_check() === FALSE

        
    //Redirect User to Log-in Page after 2 secs. 
        
    header("refresh:2; url=login.php"); 
        exit(); 

    else 

        
    //Grab User details from Session Variables and echo them. 
        
    $user $_SESSION["user"]; 
        
        
    $id $_SESSION["id"]; 
        
    $account_activation_status $_SESSION["account_activation_status"]; 
        
    $id_video_verification_status $_SESSION["id_video_verification_status"]; 
        
    $id_video_verification_url $_SESSION["id_video_verification_url"]; 
        
    $sponsor_username $_SESSION["sponsor_username"]; 
        
    $recruits_number $_SESSION["recruits_number"]; 
        
    $on_day_number_on_7_days_wish_list $_SESSION["on_day_number_on_7_days_wish_list"]; 
        
    $primary_website_domain $_SESSION["primary_website_domain"]; 
        
    $primary_website_email $_SESSION["primary_website_email"]; 
        
    $username $_SESSION["username"]; 
        
    $first_name $_SESSION["first_name"]; 
        
    $middle_name $_SESSION["middle_name"]; 
        
    $surname $_SESSION["surname"]; 
        
    $gender $_SESSION["gender"]; 
        
    $date_of_birth $_SESSION["date_of_birth"]; 
        
    $age_range $_SESSION["age_range"]; 
        
    $religion $_SESSION["religion"]; 
        
    $marital_status $_SESSION["marital_status"]; 
        
    $working_status $_SESSION["working_status"]; 
        
    $profession $_SESSION["profession"]; 
        
    $home_city $_SESSION["home_city"]; 
        
    $home_country $_SESSION["home_country"]; 
        
    ?> 
        <!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional/EN"> 
        <html> 
        <head> 
        <meta content="text/html; charset=ISO-8859-1"  http-equiv="content-type"> 
        <title><?php echo $site_name?> User's Browsing Histories in <?php echo $server_time?> time.</title> 
        </head> 
        <body> 
        <br> 
        <center><span style="font-weight: bold;"><?php echo $site_name?> User's Browsing Histories in <?php echo $server_time?> time.</span></center> 
        <br> 
        <br> 
        <?php 
        
    //Connect to Mysql Server. 

        //Get Data from Table "browsing_histories". 
        
    $sql "SELECT * FROM browsing_histories"
        
    $result mysqli_query($conn,$sql); 
        
    //Total Number of Records 
        
    $rows_num mysqli_num_rows($result); 
        
    //Total Number of Pages Records to spread-over. 
        
    $page_count 10
        
    $page_size ceil($rows_num $page_count); 
        
    //Get the Page Number, Default is 1 (First Page). 
        
    $page_number $_GET["page_number"]; 
        if (
    $page_number == ""$page_number 1
            
    $offset = ($page_number -1) * $page_size
            
            
    $sql .= " limit {$offset},{$page_size}"
            
    $result mysqli_query($conn,$sql); 
        
    ?> 
        <table width="1500" border="0" cellpadding="5" cellspacing="2" bgcolor="#666666"> 
        <?php if($rows_num) {?> 
        <tr name="headings"> 
        <td bgcolor="#FFFFFF" name="column-heading_submission-number">Submission Number</td> 
        <td bgcolor="#FFFFFF" name="column-heading_browsed-page">Browsed Page</td> 
        <td bgcolor="#FFFFFF" name="column-heading_logging-server-date-&-time">Date & Time in <?php echo $server_time?></td> 
        <td bgcolor="#FFFFFF" name="column-heading_username">Username</td> 
        <td bgcolor="#FFFFFF" name="column-heading_username">Gender</td> 
        <td bgcolor="#FFFFFF" name="column-heading_username">Age Range</td> 
        <td bgcolor="#FFFFFF" name="column-heading_home_religion">Religion</td> 
        <td bgcolor="#FFFFFF" name="column-heading_home_education">Education</td> 
        <td bgcolor="#FFFFFF" name="column-heading_home_profession">Profession</td> 
            <td bgcolor="#FFFFFF" name="column-heading_working_status">Working Status</td> 
        <td bgcolor="#FFFFFF" name="column-heading_Marital_status">Marital Status</td> 
        <td bgcolor="#FFFFFF" name="column-heading_home_town">Home Town</td> 
        <td bgcolor="#FFFFFF" name="column-heading_home_borough">Home Borough</td> 
        <td bgcolor="#FFFFFF" name="column-heading_home_city">Home City</td> 
        <td bgcolor="#FFFFFF" name="column-heading_home_county">Home County</td> 
        <td bgcolor="#FFFFFF" name="column-heading_home_region">Home Region</td> 
        <td bgcolor="#FFFFFF" name="column-heading_home_state">Home State</td> 
        <td bgcolor="#FFFFFF" name="column-heading_home_country">Home Country</td> 
        <td bgcolor="#FFFFFF" name="column-heading_contact-page">Contact Page</td> 
        </tr> 
        <?php while($row mysqli_fetch_array($result)){ ?> 
        <tr name="user-details"> 
        <td bgcolor="#FFFFFF" name="submission-number"><?php echo $row['id']; ?></td> 
        <td bgcolor="#FFFFFF" name="browsed-page"><?php echo "<a href='"
                                                              echo 
    $row['browsed_page']; 
                                                              echo 
    "'>"
                                                              echo 
    "Browsed Page</a>"?></td> 
        <td bgcolor="#FFFFFF" name="logging-server-date-&-time"><?php echo $row['date_and_time']; ?></td> 
        <td bgcolor="#FFFFFF" name="username"><?php echo $row['username']; ?></td> 
        <td bgcolor="#FFFFFF" name="gender"><?php echo $row['gender']; ?></td> 
        <td bgcolor="#FFFFFF" name="age-range"><?php echo $row['age_range']; ?></td> 
        <td bgcolor="#FFFFFF" name="religion"><?php echo $row['religion']; ?></td> 
        <td bgcolor="#FFFFFF" name="education"><?php echo $row['education']; ?></td> 
        <td bgcolor="#FFFFFF" name="profession"><?php echo $row['profession']; ?></td> 
        <td bgcolor="#FFFFFF" name="working-status"><?php echo $row['working_status']; ?></td> 
        <td bgcolor="#FFFFFF" name="marital-status"><?php echo $row['marital_status']; ?></td> 
        <td bgcolor="#FFFFFF" name="home-town"><?php echo $row['home_town']; ?></td> 
        <td bgcolor="#FFFFFF" name="home-borough"><?php echo $row['home_borough']; ?></td> 
        <td bgcolor="#FFFFFF" name="home-city"><?php echo $row['home_city']; ?></td> 
        <td bgcolor="#FFFFFF" name="home-county"><?php echo $row['home_county']; ?></td> 
        <td bgcolor="#FFFFFF" name="home-region"><?php echo $row['home_region']; ?></td> 
        <td bgcolor="#FFFFFF" name="home-state"><?php echo $row['home_state']; ?></td> 
        <td bgcolor="#FFFFFF" name="home-country"><?php echo $row['home_country']; ?></td> 
        <td bgcolor="#FFFFFF" name="contact-page"><?php echo "<a href='"
                                                              echo 
    $row['contact_page']; 
                                                              echo 
    "'>"
                                                              echo 
    "Contact Page</a>"?></td> 
        </tr> 
        <?php ?> 
        <tr name="pagination"> 
        <td colspan="19" bgcolor="#FFFFFF"> Result Pages: 
        <?php 
            
    if($rows_num <= $page_size
            { 
                echo 
    "Page 1"
            } 
            else 
            { 
                for(
    $i=1;$i<=$page_count;$i++) 
                echo 
    "<a href=\"{$_SERVER['PHP_SELF']}?page_number={$i}\">{$i}</a>  "
            } 
            
    ?> 
        </td> 
        </tr> 
        <?php } else { ?> 
        <tr> 
        <td bgcolor="FFFFFF">No record found! Try another time.</td> 
        </tr> 
        <?php }?> 
        </table> 
        <br> 
        <br> 
        <center><span style="font-weight: bold;"><?php echo $site_name?> Users' Browsing Histories in <?php echo $server_time?> time.</span></center> 
        <br> 
        <br> 
    </div> 
    <br> 
    </body> 
    </html> 
    <?php 

    ?>
    Now see my simple BABY:
    PHP Code:
    <?php  

    //Required PHP Files.  
    include 'config.php';  
    include 
    'header.php';  

    //Check if User is already logged-in or not. Get the login_check() FUNCTION to check.  
    if (login_check() === FALSE)  

        
    //Redirect User to Log-in Page after 2 secs.  
        
    header("refresh:2; url=login.php");  
        exit();  
    }  
    else  
    {  
        
    $user $_SESSION["user"];  
         
        
    $id $_SESSION["id"];  
        
    $account_activation_status $_SESSION["account_activation_status"];  
        
    $id_video_verification_status $_SESSION["id_video_verification_status"];  
        
    $id_video_verification_url $_SESSION["id_video_verification_url"];  
        
    $sponsor_username $_SESSION["sponsor_username"];  
        
    $recruits_number $_SESSION["recruits_number"];  
        
    $on_day_number_on_7_days_wish_list $_SESSION["on_day_number_on_7_days_wish_list"];  
        
    $primary_website_domain $_SESSION["primary_website_domain"];  
        
    $primary_website_email $_SESSION["primary_website_email"];  
        
    $username $_SESSION["username"];  
        
    $first_name $_SESSION["first_name"];  
        
    $middle_name $_SESSION["middle_name"];  
        
    $surname $_SESSION["surname"];  
        
    $gender $_SESSION["gender"];  
        
    $age_range $_SESSION["age_range"];  
        
    $religion $_SESSION["religion"];  
        
    $marital_status $_SESSION["marital_status"];  
        
    $working_status $_SESSION["working_status"];  
        
    $profession $_SESSION["profession"];  
         
        
    $recipient_username $user

        
    ?>  
        <!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional/EN">  
        <html>  
        <head>  
          <meta content="text/html; charset=ISO-8859-1"  http-equiv="content-type">  
        <title><?php $user ?>Notices in <?php $server_time ?> time.</title> 
        </head>  
        <body>  
        <br>  
        <center><span style="font-weight: bold;"><?php $user ?>Notices in <?php $server_time ?> time.</span></center>  
        <br>  
        <br>  
         
        <?php 
        $query 
    "SELECT id,date_and_time,recipient_username,sender_username,notice FROM notices WHERE recipient_username = ?"

        if (
    $stmt mysqli_prepare($conn$query)) 
        {
            
    //Get the Page Number, Default is 1 (First Page).     
            
    $page_number $_GET["page_number"]; 
            if (
    $page_number == ""
            {    
                
    $page_number 1
            }
        
        
    /* bind param */ 
        
    mysqli_stmt_bind_param($stmt,'s',$recipient_username); 
         
        
    /* execute statement */ 
        
    mysqli_stmt_execute($stmt);     

        
    mysqli_stmt_store_result($stmt); 
        
    $rows_num mysqli_stmt_num_rows($stmt); 
        
    printf(" %d rows found.\n",$rows_num); 
        
        
    $links_per_page 2;
        
    $total_pages ceil($rows_num $links_per_page); 
            
        
    //Bind Result Variables     
        
    $result mysqli_stmt_bind_result($stmt,$id,$date_and_time,$recipient_username,$sender_username,$notice); 
        
    ?>
        <table width="1500" border="0" cellpadding="5" cellspacing="2" bgcolor="#666666"> 
        <?php if(!$rows_num
        { 
            
    ?> 
            <tr> 
            <td bgcolor="FFFFFF">No record found! Try another time.</td> 
            </tr> 
            <?php 
        
    }
        else
        {
            
    ?> 
            <tr name="headings"> 
            <td bgcolor="#FFFFFF" name="column-heading_submission-number">Submission Number</td> 
            <td bgcolor="#FFFFFF" name="column-heading_logging-server-date-&-time">Date & Time in <?php echo $server_time ?></td> 
            <td bgcolor="#FFFFFF" name="column-heading_to">To</td> 
            <td bgcolor="#FFFFFF" name="column-heading_from">From</td> 
            <td bgcolor="#FFFFFF" name="column-heading_notice">Notice</td> 
            </tr>     
            <?php while($row mysqli_stmt_fetch($stmt)) 
            { 
                
    ?> 
                <tr name="user-details"> 
                <td bgcolor="#FFFFFF" name="submission-number"><?php echo $row['id']; ?></td> 
                <td bgcolor="#FFFFFF" name="logging-server-date-&-time"><?php echo $row['date_and_time']; ?></td> 
                <td bgcolor="#FFFFFF" name="recipient_username"><?php echo $row['recipient_username']; ?></td> 
                <td bgcolor="#FFFFFF" name="sender_username"><?php echo $row['sender_username']; ?></td> 
                <td bgcolor="#FFFFFF" name="notice"><?php echo $row['notice']; ?></td>  
                </tr> 
                <?php 
            
    }
            
    ?>
                <tr name="pagination"> 
                <td colspan="10" bgcolor="#FFFFFF"> Result Pages: 
                <?php 
                
                $rows_num 
    mysqli_stmt_num_rows($stmt); 
                
                if(
    $page_number $total_pages
                { 
                    for(
    $i=1;$i<=$total_pages;$i++) //Show Page Numbers in Serial Order. Eg. 1,2,3.
                    
    echo "<a href=\"{$_SERVER['PHP_SELF']}?page_number={$i}\">{$i}</a>  ";             
                } 
                else 
                { 
                    for(
    $i=$total_pages;$i>=1;$i--) //Show Page Numbers in Reverse Order. Eg. 3,2,1.
                    
    echo "<a href=\"{$_SERVER['PHP_SELF']}?page_number={$i}\">{$i}</a>  ";    
                } 
                
                
    ?> 
                </td> 
                </tr> 
                <?php 
        
    }
        
    ?> 
        </table> 
        <br> 
        <br> 
        <center><span style="font-weight: bold;"><?php echo "$site_name $user"?> User's Notices in <?php echo $server_time?> time.</span></center> 
        <br> 
        <br> 
    </div> 
    <br> 
    </body> 
    </html> 
    <?php 

    //Free Result Set 
    mysqli_stmt_free_result($stmt); 

    //Close Database Connection 
    mysqli_stmt_close($stmt); 

    }
     
    ?>
    Now tell me, why is this part of the code malfunctioning line 93-112:
    PHP Code:
    <tr name="headings"> 
            <td bgcolor="#FFFFFF" name="column-heading_submission-number">Submission Number</td> 
            <td bgcolor="#FFFFFF" name="column-heading_logging-server-date-&-time">Date & Time in <?php echo $server_time ?></td> 
            <td bgcolor="#FFFFFF" name="column-heading_to">To</td> 
            <td bgcolor="#FFFFFF" name="column-heading_from">From</td> 
            <td bgcolor="#FFFFFF" name="column-heading_notice">Notice</td> 
            </tr>     
            <?php while($row mysqli_stmt_fetch($stmt)) 
            { 
                
    ?> 
                <tr name="user-details"> 
                <td bgcolor="#FFFFFF" name="submission-number"><?php echo $row['id']; ?></td> 
                <td bgcolor="#FFFFFF" name="logging-server-date-&-time"><?php echo $row['date_and_time']; ?></td> 
                <td bgcolor="#FFFFFF" name="recipient_username"><?php echo $row['recipient_username']; ?></td> 
                <td bgcolor="#FFFFFF" name="sender_username"><?php echo $row['sender_username']; ?></td> 
                <td bgcolor="#FFFFFF" name="notice"><?php echo $row['notice']; ?></td>  
                </tr> 
                <?php 
            
    }
            
    ?>
    Any ideas ?
  26. #14
  27. Contributing User
    Devshed Newbie (0 - 499 posts)

    Join Date
    May 2017
    Location
    Worldwide
    Posts
    48
    Rep Power
    45
    How many times do you have to be told to stop creating variables for nothing?
  28. #15
  29. Banned (not really)
    Devshed Supreme Being (6500+ posts)

    Join Date
    Dec 1999
    Location
    Caro, Michigan
    Posts
    14,950
    Rep Power
    4554
    Do you see any silly offsetting or $query concatenation in my code ? No!
    lol.... No, I do not. You have to be ****ing with us, right? Please??

    Now, you've created a bit of html in a loop. Good on you for that. How do you plan on processing the requst, when page 3 is requested, for example? How are you showing results 21-30, assuming 10 per page.

    You have no logic handling that.

    ****.
    -- Cigars, whiskey and wild, wild women. --
Page 1 of 5 123 ... Last
  • Jump to page:

IMN logo majestic logo threadwatch logo seochat tools logo