Questions tagged as 'mysql'

4
answers

How to execute two querys on a declaration?

I need to mount a MySQL query that returns me the total of rows, and the total of rows with a value greater than 1 in the same query. Total lines : SELECT COUNT(*) FROM tabela Total lines value greater than 1: SELECT COUNT(*) FR...
asked by 26.12.2014 / 20:11
3
answers

Problems with PHP encoding in UTF-8 [duplicate]

None of the solutions suggested in various forums, websites and the like worked. I ran several tests and none of them worked and so I came here. The website where the error occurs is this: link It was not developed by me, a client of m...
asked by 29.10.2015 / 17:37
3
answers

How to not allow repeated INSERT giving reload on the page? [duplicate]

How can I do not to allow% re_completed if someone reloads the page? Example: $libera = $_POST['libera']; if ($libera == "sim"){ $sql = mysql_query ("INSERT INTO a_finan(id_reserva,id_cliente)VALUES('$id_res','$id_cliente')", $conexa...
asked by 16.01.2016 / 16:49
2
answers

Difficulty checking in MySQL

Firstly I'm starting to mess with mySQL now I'm very lazy on the subject yet I have a table that is named products_search_items and in this table there are 2 columns product_i" and search_item_id I needed to, for examp...
asked by 13.01.2016 / 16:29
3
answers

How to organize the auto-increment numbering of an id column of a table in MySQL?

I would like after each insertion or delete of my table to use a SQL script to rearrange the Ids. Currently it looks something like this: Id Nome 1 João 3 José 5 Ricardo I want to leave it like this: Id Nome 1 João 2 José 3 Ricar...
asked by 18.12.2013 / 18:00
1
answer

The ADO.NET provider with invariant name 'MySql.Data.MySqlClient' is either not registered in the machine or application config file

I have a project in MVC, and wanted to connect to the MySql database. I put this connectionStrings . <add name="Contexto" connectionString="server=127.0.0.1;User Id=xxxxxx;password=xxxxx;database=iesb_site" providerName="MySql.Data.My...
asked by 21.02.2017 / 15:31
2
answers

How to duplicate the records of a table in the DB

Well I have a DB with some records. And I would like that amount of records to double. I do not want to do double looping to show double quantity, I would literally duplicate all the records in the table. Is there any way to accomplish this?   ...
asked by 24.06.2014 / 17:34
3
answers

How to pass Id next to pagination ex: index? pag = page & ID?

I am making a website and in this site, I have a simple paging system in index.php with the following code: <?php function getGet( $key ){ return isset( $_GET[ $key ] ) ? $_GET[ $key ] : null; } $pg = getGet(...
asked by 14.08.2014 / 21:56
2
answers

Query with conditional sorting in MySQL

I have a table named comentarios , formed by columns: id , descricao , criado_em and comentario_pai , as you can see in the photo. I need to create a query, in which the answers are printed after your comme...
asked by 11.07.2018 / 20:41
2
answers

Add a number in front of all records

A question arose when assembling an sql statement. I have several records in a table called db_contrato , I wanted to add the number 0 in front of all the records, for now I defined the contract column as varchar (50). db_contract id|...
asked by 16.01.2018 / 13:56