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...
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...
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...
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...
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...
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...
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?
...
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(...
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...
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|...