我需要insert banner data into 表格wp\\U rdp\\U横幅。为了处理横幅数据,我插入了完整的附属链接,也插入了拆分链接,以将横幅url和横幅图像位置保存到单独的字段中。
Somehow there is no data inserted. 在调试中也不会得到错误报告。日志文件。当我打印r($POST)时,一切似乎都正常。字段+数据的正确数量。But nothing is insert at all.
你们中有人知道我在下面的代码中做错了什么或忘记了什么吗?
<a href="https://mobico.nl/telefoon/?tt=26156_1144596_250041_&r=" target="_blank" rel="nofollow"><img src="http://ti.tradetracker.net/?c=26156&m=1144596&a=250041&r=&t=html" width="300" height="250" border="0" alt="" /></a>
if(isset($_POST[\'add_new_banner\'])){
global $wpdb;
extract($_POST);
$fulllink = htmlspecialchars($aff_link);
$fulllink = stripslashes($fulllink) ;
preg_match_all(\'!https?://\\S+!\', $fulllink, $matches);
$affUrl =$matches[0][0]; // URL link of the banner
$imgLink =$matches[0][1]; // img link from the banner st
$company_name = get_user_meta($customer_id,\'company_name\',true);
$wpdb->insert(
$wpdb->prefix.\'rdp_banners\',
array(
\'banner_type\' => $banner_type,
\'customer_id\' => $customer_id,
\'company_name\' => $company_name,
\'start_date\' => $start_date,
\'end_date\' => $end_date,
\'price\' => $price,
\'aff_link\' => htmlspecialchars($aff_link),
\'aff_customer\' => $aff_customer,
\'aff_url\' => $affUrl,
\'aff_target\' => $aff_target,
\'aff_rel\' => $aff_rel,
\'aff_img\' => $imgLink,
\'aff_img_width\' => $aff_img_width,
\'aff_img_height\'=> $aff_img_height,
\'aff_img_alt\' => $aff_img_alt,
\'banner_link\' => $banner_link,
\'picture\' => $picture
),
array( \'%d\', \'%d\', \'%s\', \'%s\', \'%s\', \'%s\', \'%s\', \'%s\', \'%s\', \'%s\', \'%s\', \'%s\', \'%s\', \'%s\', \'%s\', \'%s\', \'%s\')
);
}
exit( var_dump( $wpdb->prepare ) );
结果=空