Questions tagged as 'mysql'

0
answers

Format JOIN result object

[PROFESSORES] id | nome | 1 | Gilson | [CURSOS] id | nome | professor_id 1 | Photoshop | 1 2 | AutoCad | 1 I would like the result of my SELECT to come in the format: (Not necessarily or exactly the same, I just want to gro...
asked by 09.11.2015 / 18:12
2
answers

Query Performance in MySql

I have in my form the option to perform a search for Rg or Cpf. Then I came to doubt about query performance using the following code: SELECT * FROM DADOSPESSOAIS WHERE (Rg = @Rg OR Cpf = @Cpf); This code above "costs" more than if I made t...
asked by 02.12.2015 / 12:02
9
answers

How to prevent SQL injection in my PHP code?

I developed a page in PHP for internal use of the company I work with and only very few people use it. You can use this page to do some queries, insertions, changes and deletions of a table in a MySQL database, however I believe that my PHP code...
asked by 03.02.2014 / 13:37
1
answer

Insert without explicit columns

I have several tables T1, T2 ... TN, each one can have columns in common or not. My final table F contains all the columns (one time only) of the previous ones. How can I insert of each one without having to explain which columns I'm insertin...
asked by 08.12.2015 / 15:01
1
answer

Upload Marker G Maps from While php

Opa, I have a .php file with a while, where I get multiple records with addresses, this file is being called in an include in my index. The while prints several divs where within each has another div that is where the google map should be dis...
asked by 09.12.2015 / 19:50
2
answers

INSERT INTO NOT EXISTS

I need to create an INSERT where it is checked whether the value already exists. I looked at some posts, but I can not execute. INSERT INTO 'pagina_extra' ('ID_PExtra', 'ordem_paginas', 'id_menu', 'url_seo', 'url', 'nome', 'titulo', 'conteudo'...
asked by 08.11.2015 / 20:40
5
answers

Save in the database the binary content of an image

How do I get the bytecode of an image at upload time to be able to store it in the mysql blob field without the need to save the image to ftp?     
asked by 04.12.2014 / 15:50
0
answers

Error: "Lock wait timeout exceeded; try restarting transaction "MySql

I am trying to feed a table in mysql with information from another table, but when I give the update it returns me this error:    Error: "Lock wait timeout exceeded; try restarting transaction ". The update code is as follows. UPDATE m...
asked by 27.11.2015 / 13:05
1
answer

Save data to DB and retrieve ID automatically [duplicate]

This is the code to save to the database using the DAO pattern, where I want to already recover the id of the registry in order to save the Usuario table that has FOREIGN KEY of the Habilitacao table: p> pub...
asked by 28.10.2015 / 16:20
0
answers

Popular a select PHP with MySQL data of city and state

I found some articles by Stack already, however, I tried anyway to make it work and I could not. I have a bank with all Brazilian states and cities, which are ok. Select Page <!-- Select Estado --> <div class="form-group"> <...
asked by 29.10.2015 / 00:54