vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   vB3 Programming Discussions (https://vborg.vbsupport.ru/forumdisplay.php?f=15)
-   -   Creating new thread/post via MySql (https://vborg.vbsupport.ru/showthread.php?t=211267)

altunozara 04-15-2009 11:00 AM

Creating new thread/post via MySql
 
$con = mysql_connect("***","***","***");
if (!$con)
{
die('Could not connect: ' . mysql_error());
}
$repostinfo[0] = 86994;
$repostinfo[1] = 81628;
$repostinfo[2] = 1;
$repostinfo[3] = 'Altuno';
$repostinfo[4] = 1;
$repostinfo[5] = 'This is an automated post';
$repostinfo[6] = 1212220036;
$repostinfo[7] = 'This should be posted as soon as a thread is deleted, this post is automated under the name of Altuno';
$repostinfo[8] = 1;
$repostinfo[9] = 0;
$repostinfo[10] = '000.000.0.0';
$repostinfo[11] = 0;
$repostinfo[12] = 1;
$repostinfo[13] = 0;
$repostinfo[14] = 0;
$repostinfo[15] = 0;
$repostinfo[16] = 0;

mysql_select_db("gamingwe_forum", $con);$sql=("INSERT INTO post (postid, threadid, parentid, username, userid, title, dateline, pagetext, allowsmilie, showsignature, ipaddress, iconid, visible, attach, infraction, reportthreadid, post_thanks_amount)".
"VALUES
('$repostinfo[0]', '$repostinfo[1]', '$repostinfo[2]', '$repostinfo[3]', '$repostinfo[4]', '$repostinfo[5]', '$repostinfo[6]', '$repostinfo[7]', '$repostinfo[8]', '$repostinfo[9]', '$repostinfo[10]', '$repostinfo[11]', '$repostinfo[12]', '$repostinfo[13]', '$repostinfo[14]', '$repostinfo[15]', '$repostinfo[16]')");
if (!mysql_query($sql,$con))
{
die('Error: ' . mysql_error());
}
mysql_close($con);

when i use this code, it is input into as a row into the "post", but it is not shown on the forum liek every other row in "post"?

Kidillusion 04-22-2009 02:57 AM

I would love to see the answer to this post. I also need to do mass insert scripts to import my posts.

Lynne 04-22-2009 03:08 AM

Take a look in the articles forum on how to insert posts/threads using the datamanager. Just adding a row to the post table is not going to do it. There is necessary info to be added/updated in the thread table also. And the user table. And probably others that I don't feel like thinking about right now.

Dismounted 04-22-2009 07:01 AM

Also see the manual: http://www.vbulletin.com/docs/html/data_managers


All times are GMT. The time now is 02:37 PM.

Powered by vBulletin® Version 3.8.12 by vBS
Copyright ©2000 - 2025, vBulletin Solutions Inc.

X vBulletin 3.8.12 by vBS Debug Information
  • Page Generation 0.00920 seconds
  • Memory Usage 1,713KB
  • Queries Executed 10 (?)
More Information
Template Usage:
  • (1)ad_footer_end
  • (1)ad_footer_start
  • (1)ad_header_end
  • (1)ad_header_logo
  • (1)ad_navbar_below
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)post_thanks_navbar_search
  • (1)printthread
  • (4)printthreadbit
  • (1)spacer_close
  • (1)spacer_open 

Phrase Groups Available:
  • global
  • postbit
  • showthread
Included Files:
  • ./printthread.php
  • ./global.php
  • ./includes/init.php
  • ./includes/class_core.php
  • ./includes/config.php
  • ./includes/functions.php
  • ./includes/class_hook.php
  • ./includes/modsystem_functions.php
  • ./includes/class_bbcode_alt.php
  • ./includes/class_bbcode.php
  • ./includes/functions_bigthree.php 

Hooks Called:
  • init_startup
  • init_startup_session_setup_start
  • init_startup_session_setup_complete
  • cache_permissions
  • fetch_threadinfo_query
  • fetch_threadinfo
  • fetch_foruminfo
  • style_fetch
  • cache_templates
  • global_start
  • parse_templates
  • global_setup_complete
  • printthread_start
  • bbcode_fetch_tags
  • bbcode_create
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • printthread_post
  • printthread_complete