Help - Search - Members - Calendar
Full Version: Inserting Blog Entries
Movable Type Community Forum > Installing and Upgrading > Importing and Exporting
TomWhitson
Hey guys, I'm new to MT and am looking for some information. I would like to be able to insert blog entries to a selected blog from my own php scripts. At the moment I have queries,

$query = "INSERT INTO mt_entry (entry_author_id, entry_blog_id, entry_status, entry_allow_comments, entry_convert_breaks, entry_title, entry_text, entry_created_on, entry_modified_on, entry_week_number, entry_allow_pings, entry_created_by, entry_modified_by) VALUES ('576', '4', '2', '1', '__default__', '$title', '$blog_answer', 'NOW()', 'NOW()', '$yearweek', '0', '576', '576')";
//$result = mysql_query($query, $blog_conn);

$entry_id = mysql_insert_id();
$query = "INSERT INTO mt_placement (placement_entry_id, placement_blog_id, placement_category_id, is_primary) VALUES ('$entry_id', '4', '8', '1');
//$result = mysql_query($query, $blog_conn);

which both run and insert the data (I've checked that they are both there) but the post does not show on the blog. Is there another table somewhere that needs an entry? From reading around there are the only two queries needed?? If there is no problem with the queries does MT show posts instantly.

Cheers for any help and suggestions.
Tom
lexA
QUOTE (TomWhitson @ Dec 12 2007, 12:12 PM) *
Hey guys, I'm new to MT and am looking for some information. I would like to be able to insert blog entries to a selected blog from my own php scripts. At the moment I have queries,

$query = "INSERT INTO mt_entry (entry_author_id, entry_blog_id, entry_status, entry_allow_comments, entry_convert_breaks, entry_title, entry_text, entry_created_on, entry_modified_on, entry_week_number, entry_allow_pings, entry_created_by, entry_modified_by) VALUES ('576', '4', '2', '1', '__default__', '$title', '$blog_answer', 'NOW()', 'NOW()', '$yearweek', '0', '576', '576')";
//$result = mysql_query($query, $blog_conn);

$entry_id = mysql_insert_id();
$query = "INSERT INTO mt_placement (placement_entry_id, placement_blog_id, placement_category_id, is_primary) VALUES ('$entry_id', '4', '8', '1');
//$result = mysql_query($query, $blog_conn);

which both run and insert the data (I've checked that they are both there) but the post does not show on the blog. Is there another table somewhere that needs an entry? From reading around there are the only two queries needed?? If there is no problem with the queries does MT show posts instantly.

Cheers for any help and suggestions.
Tom

I recently tried something similar, and have the same problem.
I think the problem is that the site needs to be 'rebuild'.
Changing the status of this entry to 'publish' (or something like that) seems to be enough to make it appear.

What is the use of the table mt_placement ?

I would also like to know how to show the post immediately.

please let me know if you've found an answer to this.

thanks.
This is a "lo-fi" version of our main content. To view the full version with more information, formatting and images, please click here.
Invision Power Board © 2001-2009 Invision Power Services, Inc.