| Server IP : 172.67.201.108 / Your IP : 216.73.216.11 Web Server : Apache/2.4.68 (Amazon Linux) OpenSSL/3.5.5 System : Linux ip-172-31-69-123.ec2.internal 6.1.176-223.369.amzn2023.x86_64 #1 SMP PREEMPT_DYNAMIC Fri Jul 24 13:34:27 UTC 2026 x86_64 User : ec2-user ( 1000) PHP Version : 8.4.23 Disable Function : NONE MySQL : OFF | cURL : ON | WGET : ON | Perl : ON | Python : OFF | Sudo : ON | Pkexec : ON Directory : /home/mitzvahm/wwwdev/_scripts/ |
Upload File : |
<?php
// Initial copy from proxi_vendors to wp_posts and set up mutual xref
include('../wp-config.php');
//echo DB_HOST;
//echo DB_USER;
//echo DB_NAME;
//phpinfo();
$con = mysql_connect(DB_HOST,DB_USER,DB_PASSWORD);
mysql_select_db(DB_NAME, $con);
$blogtime = date('Y-m-d H:i:s');
$blogtime_gmt = gmdate('Y-m-d H:i:s');
date_default_timezone_set('America/New_York');
echo(date_default_timezone_get());
mysql_query('BEGIN');
$sql = "SELECT * FROM wp_proxi_vendors WHERE post_type = 'vendor' AND post_parent = 0";
$result = mysql_query($sql) or die(mysql_error());
while($row = mysql_fetch_array($result)) :
echo '<BR />'.$row['ID'].' === '.$row['post_title'].' === '.$row['post_type'].' === '.$row['post_parent'].'<BR />';
$sql_str = "insert into wp_posts (post_content, post_title, post_name, guid, post_type, post_parent, post_date, post_date_gmt, post_modified, post_modified_gmt)
values ('".mysql_real_escape_string($row['post_content']).
"','".mysql_real_escape_string($row['post_title']).
"','".mysql_real_escape_string($row['post_name']).
"','".mysql_real_escape_string($row['guid']).
"','".$row['post_type'].
"',".$row['ID'].
",'".$blogtime.
"','".$blogtime_gmt.
"','".$blogtime.
"','".$blogtime_gmt."')";
echo $sql_str.'<br />';
$qry = mysql_query($sql_str) or die(mysql_error());
$result_insert = mysql_query("SELECT LAST_INSERT_ID() AS LastID");
$row_insert = mysql_fetch_array($result_insert);
$xref_p_id = $row_insert['LastID'];
$sql_str = "update wp_proxi_vendors set post_parent = $xref_p_id where ID = ".$row['ID'];
echo $sql_str.'<br />';
$qry = mysql_query($sql_str) or die(mysql_error());
//$sql_upd = "UPDATE wp_posts SET post_content = '".mysql_real_escape_string($str_content)."' WHERE ID = ".$row['ID'];
//$result_upd = mysql_query($sql_upd) or die(mysql_error());
//echo $sql_upd.'<BR />';
endwhile;
mysql_query('COMMIT');
?>