S
S
sashavol2017-02-19 14:00:56
MySQL
sashavol, 2017-02-19 14:00:56

How to load data into the database (from the parser)?

Hello!
I would be grateful to you for a hint who understands this.
Now there is a sql file, of the following format:

INSERT INTO `wp_posts` (post_author, post_type, post_title, post_content) VALUES ('1','job','
    Мастер ногтевого сервиса  ','
<p colspan="2" style="padding:5px;">
  <b>Описание:</b><br>
  В салон красоты и релаксации Дэлайт срочно требуется на работу мастер маникюра и педикюра.</p>

<p colspan="2" style="padding:5px;">
  <b>Требования* :</b><br>
  Опыт работы приветствуется</p>

<p colspan="2" style="padding:5px;">
  <b>Обязанности:</b><br>
  Качественное выполнение маникюров и педикюров всех видов, СПА процедуры для рук и ног, парафинотерапия, окраска и коррекция бровей, массаж рук и ног</p>

<p colspan="2" style="padding:5px;">
  <b>Условия:</b><br>
  Условия труда отличные, отдельный уютный кабинет, дружный коллектив, г/р скользящий, з/п оговаривается при собеседовании, возможно официальное трудоустройство 1/2 ставки, работа только на материалах салона.</p>

<p colspan="2" style="padding:5px;">
  <b>Контакты:</b><br>
  50-22-50, моб.тел.89116018252
<br>
ул. Маловишерская, д.3</p>
');

This is from a job site. My site is made on the wordpress engine (jobengine), the vacancies themselves in the database are in the `wp_posts` table and, in principle, they are loaded :), but the problem is that the categories of vacancies are in another table `wp_term_relationships`, and it takes a unique `wp_posts` line id and category id. So is there any way to simplify this? To make everything easier to download.
I now have such a scheme, I run the nodejs parser, it collects links, then I run another file, it collects the necessary data (vacancy) into the database, and then I want to manually upload it to my database, but here is such a thing, there are tables others, but in the main table `wp_posts` the unique id "ai" is generated by itself, i.e. I somehow need to categorize these vacancies, but I don't know how :)
It would also be great if there are those who know how to write to the database with nodejs right away, I do everything locally, it doesn’t work for me (do I need a dedicated server?). I would have paid for this thread.
П,С I can only program in jquery - this is my level

Answer the question

In order to leave comments, you need to log in

1 answer(s)
A
Alexander Pushkarev, 2017-02-19
@AXP-dev

Use https://wp-kama.ru/function/wp_insert_post

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question