Welcome to the Question2Answer Q&A. There's also a demo if you just want to try it out.
+10 votes
590 views
in Q2A Core by

here is the old solution for that 

https://www.question2answer.org/qa/1222/what-is-the-best-way-for-me-to-upload-lot-of-questions-to-the-db

but i want use the easy  functions for creating database content, defined in:

qa-app-posts.php

2 Answers

0 votes
by

Check

https://www.question2answer.org/qa/54488/new-premium-plugin-bcg-bulk-content-generator?show=54488#q54488

It is a good complement and fully functional. I like to use it on my site!

@pupi1985

+3 votes
by

The basic structure would be like this:

<?php
require_once '/PATH/TO/qa-include/qa-base.php';
require_once QA_INCLUDE_DIR.'app/posts.php';

$questions = []; // do something here to get your list of questions

foreach ($questions as $question) {
    qa_post_create('Q', null, $title, $content, $format, $categoryid, $tags, $userid);
}

The variables like $title would come from your questions array, so it may be $questions['title'], $questions['content'] and so on. If you don't have a user ID to use then use null and they will show as anonymous.

by
What about answers? How I can add them?
...