【发布时间】:2011-05-27 00:30:23
【问题描述】:
我不打算实现所有 wp_post 功能。
我感兴趣的东西(这给我带来了问题,因为我没有得到正确的关系)是将值插入和更新到的 sql 1.职位表 2. 术语表 3. term_taxonomy 4项关系
发帖时的表格。
$sql="update wp_posts set post_title='$name', post_name='$slug', post_content='$freeRTE_content', post_category='$category', post_status='$post_status', comment_status='$comment_status', mode_application='$howtoapply', website_address='$website', company_email='$email', application_deadline='$last_date', advert_date='$advert_date', post_date='$date', featured='$featured', course='$course', location='$location', grade='$grade' where id='$id'";
if(mysql_query($sql, $link))
{
$expq=explode(',' , $q);foreach($expq as $key=>$value){$expq[$key]=trim($value);}$newq=join(',',$expq);
$sql="insert into wp_term_relationships (term_taxonomy_id) select term_taxonomy_id from wp_term_taxonomy tt, wp_terms t where name in ('$newq') and taxonomy='post_tag' and t.term_id=tt.term_id";
if(mysql_query($sql, $link))
{
$sql="update wp_term_taxonomy tt, wp_terms t set count=count+1 where name in ('$newq') and taxonomy='post_tag' and t.term_id=tt.term_id";
$result=mysql_query($sql, $link) or die(mysql_error($link));
}
}
}
我没有正确理解这四个表之间的关系,请问我该如何解决这个问题?
(请不要在 wordpress 环境中工作,而是使用 wordpress 结构)
【问题讨论】:
-
“我不是在 wordpress 环境中工作,而是在使用 wordpress 结构” - 祝你好运! :-)