Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- $sql="";
- $dbhost = "localhost";
- $user = "root";
- $password = "";
- $db = "wp";
- $conn = mysql_connect($dbhost,$user,$password);
- echo "[conn=$conn]<br>";
- $sql="select sid, catid, aid, title, time, hometext, bodytext, comments, counter, topic, informant, notes, ihome from wp.stories";
- if($conn){
- $result = mysql_query($sql);
- echo "[result=$result]<br>";
- $nb = mysql_num_rows($result);
- echo "[nb=$nb]<br>";
- while(list($sid, $catid, $aid, $title, $time, $hometext, $bodytext, $comments, $counter, $topic, $informant, $notes, $ihome) = mysql_fetch_row($result)) {
- echo "----------------------------------------------------------------------<br>";
- $title = addslashes($title);
- echo "<br>title=$title<br>";
- $hometext = addslashes($hometext);
- echo "<br>hometext=$hometext<br>";
- $bodytext = addslashes($bodytext);
- //echo "<br>hometext=$hometext<br>";
- $sqlinsert="INSERT INTO `wp`.`wpfr_posts` (
- `ID` ,`post_author` ,`post_date` ,`post_date_gmt` ,`post_content` ,`post_title` ,`post_excerpt` ,`post_status` ,`comment_status` ,`ping_status` ,
- `post_password` ,`post_name` ,`to_ping` ,`pinged` ,`post_modified` ,`post_modified_gmt` ,`post_content_filtered` ,`post_parent` ,`guid` ,`menu_order` ,
- `post_type` ,`post_mime_type` ,`comment_count`
- )
- VALUES (
- $sid , 1, '$time', '$time', '$hometext <!--more--> $bodytext', '$title', '', 'publish', 'open', 'open', '', '', '', '', '$time', '$time', '', '0', '', '0', 'post', '', '0'
- );
- ";
- // echo "<br>sqlinsert=[$sqlinsert]<br>";
- $insert = mysql_query($sqlinsert);
- echo "<br>insert=[$insert]<br>";
- }
- if($result){
- }else{
- echo "<br>sql=$sql<br><br>";
- echo "error mysql_query<br>";
- }
- }
- else{
- echo "<br>conn=$conn<br>";
- echo "<br>sql=$sql<br>";
- echo "error connect db";
- }
- ?>
Add Comment
Please, Sign In to add comment