Questions tagged as 'mysql'

1
answer

Error MySQL characters invalid?

I'm using this query to search the database: SELECT * FROM cidades WHERE cidade LIKE ? LIMIT 1 In placeholder I used "Narnia" And I received this error: General error: 1267 Illegal mix of collations (utf8_bin,IMPLICIT) and (utf8mb4_gen...
asked by 19.09.2016 / 06:39
1
answer

How to count equal records in a single column and get that same number?

Table example: | Ti | Orien | | ---| JML | | ---| JML | | ---| RGM | | ---| AAA | | ---| AAA | Example result: JML - 2                    RGM - 1                    AAA - 2     
asked by 18.10.2016 / 15:46
1
answer

Formatting with php of numeric to save in the mysql database as DECIMAL

I'm implementing Ckeckout Cielo, and numeric values are always returned for prices. Monetary values are always treated as integer values, without representation of decimal places, with the last two digits being regarded as the cents. Ex...
asked by 18.10.2016 / 15:58
2
answers

Trigger that accumulates the MySQL result

Given the following tables: Player ( id; name number; ) j team_ficticia ( id; userId; name; puntuacao_ficticia; ) ef team_fiction_player ( id; teamFicticiaId; pilotId; ) efj step ( id; local; year; state; ) and puntuacao_ficticia_...
asked by 31.07.2016 / 16:13
1
answer

Query to get all records regardless of whether or not they exist in another table

I'm running an app from a store where users can leave equipment to be arranged. So I did a php to look for those users who have already left some equipment by name: $sql = mysqli_query("$conexao, SELECT u.contribuinte, u.nome,...
asked by 27.07.2016 / 17:57
1
answer

insert array foreach

I have a problem with entering data in the database with php, I have a form with several checkboxes, so I want to select more than 1 checkbox and insert it into the database, so I did form <input type="checkbox" name="f_carteira[]" value...
asked by 17.07.2016 / 18:59
1
answer

How to sort query using PDO?

How can I sort my query from the most recent to the oldest date. Is this my Query? public function RetornaAtualizacoesFuncionarios($data,$codusuario){ $WHERE = array() ; if( !empty( $codusuario ) ) {$WHERE[] = "codusuario = $cod...
asked by 05.10.2016 / 20:04
1
answer

Retrieve JSON values and assemble HTML for each record

I'm having doubts about how to structure a JQuery that should append an HTML code to each of the items a JSON returns me. My question is how to retrieve each of the JSON values and do a repeat structure to create the HTML that will eventu...
asked by 06.10.2016 / 17:38
2
answers

How to show the number records in PDO using COUNT (*)?

Hello,I'mdoingasystemthatliststhelatestupdatesinthedatabase,untilit'sallright,Ijustwantedtoprintthenumberoftotalupdatesthattheusermadetothetable.HowcanIdothis?Thankyouinadvance.TypemoreorlessusingSELECTCOUNT(*)ThisisthecodethatForeachdoes<?p...
asked by 05.10.2016 / 20:54
1
answer

How to use AND?

I would like to know where I can put AND tipregistro = 'mysql' so that when both !empyt and when you do not have tipregistro = 'mysql' this is my query public function RetornaAtualizacoesFuncionarios($data,$codusuario){...
asked by 05.10.2016 / 17:56