Questions tagged as 'sql-insert'

2
answers

How to insert into tables with many-to-many relationship?

I have a question about how I'm going to do the insert with relationship n:n My tables are: Recibo Analise Analise_Recibo (recibo_id, analise_id)     
asked by 20.12.2014 / 12:54
1
answer

SQL does not keep new recordings

I'm using a Service-based Database (.MDF) to save some data from an application I'm developing. However, after I close the application, the data that was entered in the table disappears. Here is the code I'm using: System.Data.SqlClient.SqlCon...
asked by 23.11.2014 / 21:47
1
answer

Inserting data with PHP OO (Similar to EntityManager.persist (Object) java manager)

I would like a hint of how to loop to insert an object into the mysql / postgres database ... Example class User { // PRIMARY KEY public $id; public $login; // PRIMARY FOIREIGN KEY public $people; __construc...
asked by 11.06.2014 / 14:16
0
answers

Store query result in a session with PDO

I have a SELECT which generates results normally, but when I need to get the value of some column to use on another page it does not work. Query code and attempt to pass the result of a column to a session: $login = $conexao->prep...
asked by 30.10.2018 / 00:44
0
answers

Insert Error: Incorrect integer value 'EXAMPLE' for column 'id_example' at row 1

I am trying to insert into my mySQL database through Visual Studio 2017 - C # (localhost-wamppserver) but it is giving error. The first column of the records table is the record_id which is the primary key of the records table and is auto_inc...
asked by 01.06.2018 / 11:48
1
answer

Insert data from an array into the database by CodeIgniter

I am trying to make a INSERT using CodeIgniter and would like to know if there is a more practical form than the one used below: MODEL public function set_cliente() { $dados = array( 'codigo_cliente' => $this-&...
asked by 27.09.2017 / 20:58
2
answers

Last ID lastInsertId

Good afternoon Personal I'm trying to get the ID that was entered by my class but without success. The examples I found none worked. If anyone can help thank you. public function insert_orcamento($numero, $cod_cliente) { $sql = "INSER...
asked by 25.10.2016 / 21:29
1
answer

Insert an ID in SQL + PHP

I am making a form where the user inserts the data and the same one receives the confirmation along with an ID record in php with sql, I am just not getting this final confirmation along with the id, can anyone help me? I know that mysql is l...
asked by 09.09.2016 / 15:50
1
answer

PHP script script from MS Sql for My Sql

Good afternoon. How can I make a query in MS Sql and insert the values into a My Sql table through PHP? Looking at this data, can you do this insertion? #--> conexao mysql require_once("mysql.php"); #--> conexao mssql...
asked by 23.10.2015 / 18:42
1
answer

CakePHP3 HABTM error inserting data into table

I have the error Can not insert row in "addresses_companies" table, it has no primary key in my application, after entering a company and filling in the address data and selecting a company appears the error quoted above. Follow the code below...
asked by 24.08.2015 / 04:29