Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- $db = mysql_connect("localhost", "root", "");
- mysql_select_db("ajax_search");
- mysql_query("SET CHARACTER SET utf8");
- $sString = "doc";//mysql_real_escape_string($_GET["search"], $db);
- $sql="SELECT * FROM `articles` WHERE `title` LIKE '%$sString%' OR `content` LIKE '%$sString%' ORDER BY `id` DESC LIMIT 10";
- $rs=mysql_query($sql,$db);
- if (mysql_num_rows($rs) > 0)
- {
- while ($row = mysql_fetch_array($rs))
- {
- echo $row["title"];
- ?>
- </br>
- <?
- }
- }
- echo $sql;
- ?>
Add Comment
Please, Sign In to add comment