Jump to content

aaryan2290

New Members
  • Posts

    1
  • Joined

  • Last visited

aaryan2290's Achievements

Newbie

Newbie (1/5)

0

Reputation

  1. 2nd page in pagination doesnt show any results ,first page is working fine ,please help me my code is as follows $sql="SELECT ID, FirstName, LastName FROM Contacts WHERE FirstName LIKE '%" . $name . "%' OR LastName LIKE '%" . $name ."%'" ; //-run the query against the mysql query function //-display the result of the array $total_records = mysql_num_rows(mysql_query($sql)); $sql .= " LIMIT $start, " . NUMBER_PER_PAGE; $loop = mysql_query($sql) or die ('cannot run the query because: ' . mysql_error()); while ($record = mysql_fetch_assoc($loop)) $result=mysql_query($sql); //-create while loop and loop through result set while($row=mysql_fetch_array($result)){ $FirstName =$row['FirstName']; $LastName=$row['LastName']; $ID=$row['ID']; echo "<li><h1>" . "<a href=\"search.php?id=$ID\">" .$FirstName . " </h1></a><a> " . $LastName . "</a></li>\n"; echo "</ul>"; } echo "<center>" . number_format($total_records) . " search results found</center>"; pagination($page, $total_records, "Firstname=$nameORLastName=$name");
×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.