Home > Article > Backend Development > php search function
I’ve been very irritable recently and don’t know how to start learning a piece of code, so I want to write more things for future review.
Recently, after looking at the search function for a few days, I wanted to modify and optimize the search function of phpcms, but I didn’t have any clue. Maybe I slept too late recently, so I rewrote the simple search and organized my ideas.
A simple search only requires constructing a query statement
$sql = "SELECT * FROMsqlWHERE $ziduan LIKE'%$content%'"
After constructing the SQL database query, you can execute the database query
$rs=$db->query($sql);
$rsNum=$rs->num_rows; //返回查询的行数echo "本次查询到 $rsNum 条记录";
').addClass('pre-numbering').hide();
$(this).addClass('has-numbering').parent().append($numbering);
for (i = 1; i ').text(i));
};
$numbering.fadeIn(1700);
});
});
The above has introduced the PHP search function, including related content. I hope it will be helpful to friends who are interested in PHP tutorials.