SitePoint Sponsor

User Tag List

Results 1 to 2 of 2
  1. #1
    SitePoint Member WaveLine Media's Avatar
    Join Date
    Jul 2003
    Location
    Olympia, WA
    Posts
    12
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Question Why wont this work?

    Im trying to display the results from a search (variable named: $search)
    The results come out fine but the "previous and next" links do not. Right now I have it set to just show 2 results per page just for testing purposed. If you could look at my code and see what im doing wrong that would be great.

    Thanks

    Code:
    PHP Code:
    <?php
    // Get connection info
    include "../connect.php";
    // End connection info
    if(!$rowstart$rowstart=0;

    // Start database select
    if ($search) {
     
    $result mysql_query(
    "SELECT * FROM _adult WHERE notactive='$notactive' order by date desc limit $rowstart,2"); //Select Database
    $result2 mysql_query("select * from _adult");

    if (!
    $result) {
    echo(
    "<P>Error performing query: " .
    mysql_error() . "</P>");    exit();  }
      
    // Display the text of each host
    while ( $row mysql_fetch_array($result) ) {
     
    if (
    $notactive 1) {
    echo (
    "<table width=500 height=57  border=0 cellpadding=0 cellspacing=0>");
    echo (
    "<tr>");
    echo (
    "<td align=left valign=top><strong>" $row["name"] . "</strong></td>");
    echo (
    "</tr>");
    echo (
    "<tr>");
    echo (
    "<td align=left valign=top>" $row["desc"] . "</td>");
    echo (
    "</tr>");
    echo (
    "<tr>");
    echo (
    "<td align=left valign=top><a href=" $row["url"] . ">"$row["url"] ."</a></td>"); }
    echo (
    "</tr>");
    echo (
    "<br><br>");
    echo (
    "</table>");
     
     
    }
    if (
    $rowstart>$numrows)
    {
    echo 
    "<br><br>";
    $limit1 $_GET['rowstart'] - 2;
    echo 
    '<a href="'.$_SERVER['PHP_SELF'].'?rowstart='.$limit1.'">< Previouse Page</a>';
    }

    $numrows=mysql_num_rows($result2);
    if(
    $rowstart+3<$numrows)
    {
    $limit $_GET['rowstart'] + 2;
    echo 
    '<a href="'.$_SERVER['PHP_SELF'].'?rowstart='.$limit.'">Next Page ></a>';
    }}
    ?>
    WaveLine Media - http://www.wavelinemedia.com
    Professional small business website design and developing

  2. #2
    Kitty Lizard reptilianfeline's Avatar
    Join Date
    Aug 2002
    Location
    Somewhere in Cyberspace
    Posts
    385
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Does it print the links but without proper addresses, or not at all?
    Reptilian Feline
    | www.reptilian-feline.net | Art | Tutorials | Pets | Music |
    Webdesign the hard way...


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
  •