Home  >  Article  >  Backend Development  >  Analysis of PHP paging principles, examples of getting started with PHP paging code

Analysis of PHP paging principles, examples of getting started with PHP paging code

WBOY
WBOYOriginal
2016-07-25 08:52:43838browse
  1. $conn = @ mysql_connect("localhost", "root", "123456") or die("Database link error");
  2. mysql_select_db("bbs", $conn);
  3. mysql_query("set names 'gbk'"); //Use gbk Chinese encoding;
  4. //Convert spaces and newlines into html parsable
  5. function htmtocode($content) {
  6. $content = str_replace("n", "< ;br>", str_replace(" ", " ", $content)); //Two str_replaces nested
  7. return $content;
  8. }
  9. //$content=str_replace("'","'", $content);
  10. //htmlspecialchars();
  11. ?>
Copy code

3) Display page

[code]

$numq=mysql_query("select * from `message`"); $num = mysql_num_rows($numq); //Total number if($_get



Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn