L
L
lemonlimelike2017-09-19 18:19:30
PHP
lemonlimelike, 2017-09-19 18:19:30

How to make an insert request?

I can't query the database at all. In general, to the point. There is a form It is cb3c9a940d2d4221857a2cecd6dae653.jpg
necessary to build a query so that it adds both fields with name="cat" to the table.
I did this, but the error...

INSERT INTO video_category(video_id, category_id) VALUES(:video_id, :cat, :cat)

Here is what the table looks like26d89aca20204149a4e77687997d89a1.jpg

Answer the question

In order to leave comments, you need to log in

1 answer(s)
D
Denis Holub, 2017-09-19
@lemonlimelike

So you insert 3 into 2 fields.
Rename the second input name to cat2.

INSERT INTO video_category(video_id, category_id) VALUES(:video_id, :cat)
INSERT INTO video_category(video_id, category_id) VALUES(:video_id, :cat2)

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question