암호 및 사용자 이름을 고의로 사용하여 mySQL 쿼리를 작성했습니다. 반환하는 것은 하나의 결과 만이 그 결과에 대한 오늘 날짜보다 다른 정보를 반환하지 않는 것입니다. 어떤 검색이 작동하지 않는지는 중요하지 않습니다.mySQL 검색이 실제로 작동하지 않습니다.
<?php
$proto = $_GET['p'];
$terms = $_GET['f'];
$return;
if($proto == 'inline'){
echo 'checking';
$username="*******";
$password="*******";
$database="*******";
$my_text = $_GET['f']; //what I'm searching for
$my_category = '8'; //whatever category number it is
mysql_connect(localhost,$username,$password) or die(mysql_error());
mysql_select_db($database) or die(mysql_error());
$result = mysql_query("SELECT ID FROM wp_posts WHERE post_title LIKE '%$my_text%' ");
// select all posts that have your text
while ($row = mysql_fetch_array($result));
$postname = $row['post_name'];
$posttitle = $row['post_title'];
$postID = $row['ID'];
$date = date ('d-M-Y' , strtotime($row['post_date']));
$return.= '
<a href="http://www.robin-knight.com/' . $postname .'">'.$posttitle.' ('.$postname.')<br /><span style="font-size:10px; color:#555;">'.get_the_time("d-M-Y", $postID).' - '.get_post_meta($postID, "status", true).'</span></a>
';
//while have posts
echo $return;
}
?>
SQL이 작동하는 방식을 배우는 시간입니다 ... – ceejayoz
무엇이 질문입니까? 또한 "실제로 작동하지 않는다"는 것은 무엇을 의미합니까? –
좋은 SQL 주입 구멍. 누군가 당신의 데이터베이스에 주차 할 트럭을 좋아하길 바랍니다. –