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

WBOY
Release: 2016-07-25 08:52:43
Original
846 people have browsed it
  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



source:php.cn
Statement of this Website
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
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template
About us Disclaimer Sitemap
php.cn:Public welfare online PHP training,Help PHP learners grow quickly!