$results = mysql_query ("SELECT body, title FROM $source_db.Post");
while ($row = mysql_fetch_array($results)) {
if(mysql_num_rows($users_result) > 0){
$insert = "INSERT INTO wp_posts (`body`,`title`) VALUES ('{$row['body']}', '{$row['row']}')";
mysql_query($insert);
}
}
와 같이 특정 필드를 새 DB로 이동하는 스크립트를 작성했습니다. 단, 큰 따옴표로 인해 매번 쿼리가 중단된다는 것을 알 수 있으므로이 문제에 대한 해결책이 있습니다. herdok 또는 무언가 같이
INSERT INTO wp_posts (`body`,`title`)
VALUES
('Here are the final returns from today's ...<br /><br />he stayed home...<br />
<div class="entry-content">
<div class="entry-body">', 'something')
http://stackoverflow.com/questions/601300/what-is-sql-injection –
[PHP에서 SQL 삽입을 중지하는 가장 좋은 방법] (http://stackoverflow.com/questions/60174/best) -way-to-stop-sql-injection-in-php) –