Most voted "sql-insert" questions
INSERT is the ANSI standard SQL command to insert records into the database.
Learn more…213 questions
Sort by count of
-
0
votes1
answer272
viewsError 1452 Mysql
I’m starting in mysql, so don’t notice the badly made tables. Finally I have the following tables: create table Alunos ( MAT int, nome varchar (45), endereco varchar (45), cidade varchar (45),…
-
0
votes0
answers490
viewsinsert into two tables at the same time with php
I’m in trouble. I have the tables usuario and aluno which are related by primary and foreign key. I want to make an insertion with php to insert data into the two tables, the idusuario table usuario…
-
0
votes1
answer674
viewsProblem with Insert using mysql_query()
I’m working on an old system, in which makes the connection to the bank still with mysql_query. I used very little mysql_query and the last time I used it a long time ago, I’m more used to PDO. I’m…
-
0
votes1
answer341
viewsInserting data with PHP using classes and PDO
Good evening guys. I have the task of creating a complete CRUD on the site where I work. However I need to use classes and methods with PHP. See what happens. I have the class usuario.class, where I…
-
0
votes1
answer8422
viewsHow to insert data into a Mysql B.D with PHP
This is the form to enter data <html> <head> <title></title> <meta charset="utf-8"> <link rel="stylesheet" href="style.css"> </head> <body> <form…
-
0
votes1
answer109
viewsRegistration in foreach php
all right? I’m trying to register several entries in the comic according to the number of installments requested, but I’m not getting. My code: php: $Conn = parent::getConn(); try { foreach…
-
0
votes2
answers60
viewsSave to the bank who edited profile
I’m developing a system that registers employees of companies. In this system I have the staff tables and users. Table employees have the data id|nome|empresa|data_cadastro|user_view|user_edit User…
-
0
votes2
answers1035
viewsHow to insert value in mysql with PHP and Ajax
I have the following page of recipes, which brings the list of ingredients: <?php $db->setQuery("Select * from #__ingredientes"); $tmpingredientes = $db->loadObjectList(); ?> And from…
-
0
votes3
answers437
viewsVisual Studio INSERT command error
I have a web application in visual studio where I am getting the following message whenever I try to give an Insert command System.Data.Sqlclient.Sqlexception: 'An Explicit value for the Identity…
-
0
votes1
answer254
viewsInsert using parameters in the C# application for the Oracle database error: ORA-01036: invalid variable name/number
I noticed that there are many questions about this error but none solved my case the connection works normally, there is the Insert method(): public bool Insert(ArrayList arrAlunos) { vsql = "insert…
-
0
votes0
answers109
viewsProblem with mysqli_insert_id - Class
I have a problem getting the last id inserted in a table, for the same is returning empty. I searched the stack but couldn’t find a solution. Script for inclusion of information in the BD: if (…
-
0
votes2
answers215
viewsProblem inserting data into a table containing foreign keys
Hello, everybody! Well... here’s my problem: I have a Mysql database that has 3 tables (Client, Event, Equipment). The event table has two foreign keys, the first of them referencing the id of the…
-
0
votes2
answers56
viewsPHP form does not save
I have this html form: <form id="addRunner" name="addRunner" action="service.php" method="POST"> First Name: <input type="text" name="txtFirstName" id="txtFirstName" value=""…
-
0
votes1
answer299
viewsProblems using INSERT in PHP (mysqli)
i (beginner in the field of php development) am having problems inserting data using the code below: <?php $conn = new mysqli("zz", "zz", "zz", "zz"); // Alterei a string de conexão por questão…
-
0
votes1
answer91
viewsignore existing lines in the database when importing php file
I have the following line of code that performs the txt file import. <?php function Inserir($itens, Pdo $pdo){ $sts = $pdo->prepare("INSERT INTO dados(loja, cod_prod, cod_acesso, desc_prod,…
-
0
votes2
answers537
viewsProcedure of Insert in three tables
Good morning everyone I am trying to change a precedent I created to insert a new book in three tables the table has autoencrement in the id_book column, and tables B and C are not null, I am using…
-
0
votes0
answers65
viewsFatal error: Uncaught Error: Call to Undefined Function idbancoExist() in
I’m running bank records for one-page users. When performing the code test on localhost everything is working fine, but when I upload to the server I have it shows the error: Fatal error: Uncaught…
sql-insertasked 5 years, 10 months ago everson 11 -
0
votes1
answer102
viewsMYSQL connection error on Android using php
I’m trying to connect my Android Java application via php with my MYSQL database and insert data in it, but despite the Android application report that the "user was successfully registered" the…
-
0
votes1
answer504
viewsInsert array into database using PHP and SQL
I’m trying to insert values from a array inside the database using PHP, but I’m having difficulty in the applied method. It’s the first time I use arrays for that reason. My current code is:…
-
0
votes1
answer149
viewsHow to insert xml tag within a sql server table
I am trying to insert an XML tag that is allocated within a field in an SQL table (SQL SERVER) I am currently trying so but am unsuccessful: update UserData set tp_ColumnSet.modify('insert…
sql xml sql-update sql-insert sql-server-2012asked 5 years, 4 months ago Guilherme G. Bitencourt 11 -
0
votes1
answer41
viewsDatabase parameter insertion error (with files that have the same code)
Hello to those who are reading the question I would like to help with an Insert problem I am facing with a registration program I found on the internet and when making the first version it did not…
-
0
votes1
answer48
viewsDuplicate records in the database table
I have the following model: function validarQuestionario() { if(is_array($this->input->post('resposta[]')) || is_object($this->input->post('resposta[]'))) { foreach…
-
0
votes0
answers166
viewsError in performing the Insert in oracle
I’m having problems to perform the Insert in a table called accounts, however I have relationship with the company table. In the company table I have the following fields: Id_empresa | Nome_Empresa…
-
0
votes2
answers103
viewsError giving python Mysql Insert
I have the table in my bank: create table tweets( ID_Tweet int not null auto_increment, ID_Candidato int not null, Conteudo_Tweet varchar(470) not null, constraint PK_tweets_ID primary key…
-
0
votes1
answer200
viewsForeign key breach error only in inclusion via API, via insertion bank is correct
I have a . NET Core API that connects to a Postgres database using Entity Framework. For each table that needs to do some insertion I have the model with the right fields (created by hand because I…
postgresql entity-framework asp.net-core sql-insert foreign-keyasked 4 years, 10 months ago Ianagos 71 -
0
votes1
answer28
viewshow to use the SELECT statement to be inserted in a column in the same table?
SELECT Names,SUBSTRING(Names,10,50) AS Alias FROM NameToSplit; Here I do not want to put the Aliases, but INSERT in the column Alias this Select statement. then I need to take this column Alias and…
-
0
votes3
answers401
viewsCheck CPF and Email fields before sending to the database (PHP)
Good night! I would like to know how I can implement a function (maybe?) or some method to check if the fields Cpf and e-mail in my code already exist in the bank before registering them, and if it…
-
0
votes2
answers157
viewsMysql message: #1241 - Operand should contain 1 column(s) - Copy data from different tables and databases
I need to copy database A data from table A (14columns) to Database B table A (15columns) I need to check accountid if there is no database B table A must copy the data, if there is no. I tried the…
-
0
votes0
answers41
viewsERROR 1136 PROCEDURES + INSERT + FOREIGN KEY
This error is appearing and I am not managing to solve it: ERROR 1136 PROCEDURES + INSERT + FOREIGN KEY The number of parameters is equal. Did I do something wrong on constraint? Follows the Code:…
-
0
votes1
answer145
viewsSimple quotes breaking the UPDATE query in mysql
I have the following difficulty, in my application, when executing the registration function, when I type some text with enclosed quotes, the query does not work. Follow the code below: Here I take…
-
0
votes0
answers26
viewsInserting column in mysql database table and after doing the update in the same column created
I’m developing a system: 1- The "USER" of the system registers a service for a particular client who contracted that service. 2- This registration is done via a form.php... 3- Send this data…
-
0
votes1
answer46
viewsSQL Server - insert data after comparison of 2 tables
I have 2 tables where I want to compare the price of products: TABLE: PRODUCT produto preco A 4.5 B 6 C 10 TABLE: RANGE PRICE produto valor minimo valor maximo A 3.2 6.7 B 2.1 4.5 C null null I…
-
0
votes0
answers24
viewsString concatenation from variables in the execute method of sqlite3 in python
I am trying to insert data into a table created in Python (module sqlite3) indirectly, that is, through variables that receive the values of inputs and not directly by typing them into the string of…
-
0
votes1
answer52
viewsTrigger Insert in the same table
Hello, I have a table where I keep records of movements, it is inserted a record where it is possible to inform a payment installment, for example, a purchase made in 12 times whose current…
-
0
votes0
answers19
viewsHow to make an Insert with select using bdlink
I need to do an Insert along with select looking for data from another database, for this I’m using dblink, but I’m not getting, I use pgadmin4 declare insertCad RECORD; begin for insertCad in…
-
0
votes1
answer25
viewserror with Insert and mysql
I have the following method: public byte[] CarregarArquivoImagem( Int64 idVenda,string nomeArquivo, string caminhoArquivo, int ImagemTamanhoMaximo) { string query = null; MySqlDataReader reader;…
-
-1
votes1
answer66
viewsINSERT in mysql in another domain
Insert mysql into another domain. For example: on my site has the site administrator, and there I can register my products, when registering, will register on my site and on another site outside my…
-
-1
votes1
answer818
viewsSave an Arraylist<> to an SQLITE table
Speaks Galera, I’m wanting to save an array list in a table in SQLITE, can I do it? If yes, how? This is my table: db.execSQL("create table amc (_id integer primary key autoincrement,tipo text not…
-
-1
votes4
answers582
viewsHow do I SELECT then INSERT
How do I select and return more than 1 record does the UPDATE and return 0 records does the INSERT ? Look how I did it here only it’s not working: if(isset($_POST['submit'])){ $query =…
-
-1
votes2
answers80
viewsInsert line in MYSQL without leaving the page (using PHP)
I have a music download system with a download button and I would like when clicking the button, it insert a line in the database, without leaving the page. Currently what I did is it open a new…
-
-1
votes2
answers1770
viewsINSERT PHP MYSQL does not insert
I have a simple problem with INSERT in the PHP with MYSQL , happens that it does not insert anything in the database , already put to report the errors but does not work , I’m using vertrigo server…
-
-1
votes1
answer32
viewsScan 4 selects and display message
Speak up, people, blz? I would like to know how to make the following logic in SQL: if( 1 = select * from tblA or 1 = select * from tblB or 1 = select * from tblC or 1 = select * from tblD or )…
-
-1
votes1
answer42
viewsinsert xml record plus date into a time table
I wanted to make this select but I can’t > DECLARE @XML XML > SET @XML = > '<rows> <row> <tracking> JU148345357BR</tracking> </row> <row>…
-
-1
votes1
answer26
viewsInsert random numbers through Precedent
I am trying to insert some random record into a table but am encountering some errors. I created a test table; `create table teste_p(Handle int, name varchar(20)); I need to insert something like:…
-
-1
votes1
answer81
viewsHow to insert data into two tables related to each other by foreign key at the same time?
I could use a hand with that. I’m trying to input data into the database using two tables related to Foreign key, but I can’t do it when there are more than two tables. I even managed to do it with…
sql-insertasked 3 years, 9 months ago Wanderson Silva 17 -
-1
votes2
answers46
viewsHow to join edit/new button?
I would like, if there is already $nome registered in the table, it gives an update and if it does not exist, it gives an input. I do not understand what the problem in my code. $dbconn =…
-
-1
votes1
answer84
viewsI don’t understand this mistake
My PHP code: <?php include "conectar.php"; //comando para iserir dados direto do formulário para o banco de dados $vnome=$_POST['nome']; $vcpf=$_POST['cpf']; $videntidade=$_POST["identidade"];…
-
-1
votes1
answer282
viewsimporting Xml data into Mysql database - Only save the LAST record
In this code all XML records are read, but in the Mysql database only the last XML block is saved. I know that reading each record over-writes the previous one but the strange thing is that I gave…
-
-1
votes1
answer298
viewsHow to Set PHP 7 Variable for POST?
I am trying to record information from a form on a basis, but when I Gero the following code below is presented an error in the file saying that: Notice: Undefined index: txtFirstName in…
-
-1
votes1
answer42
viewsINSTER MYSQL PHP PDO ERROR
I’m trying to make an Insert using PHP PDO, but it is always returning an error, which I am not able to solve $insert = "INSERT INTO usuarios ('usuario', 'senha', 'telefone', 'email', 'tipo',…