Questions tagged as 'mysql'

1
answer

Passing results from an array to variables

The query below returns the total number of records per modality: $sql = "SELECT modalidade, COUNT(*) as total FROM a_finan GROUP BY modalidade"; $resultado = mysql_query($sql) or die( mysql_error()); while ($linha = mysql_fetch_assoc($res...
asked by 17.04.2015 / 15:02
1
answer

Do the INSERT of an Array, regardless of the amount of $ _POST

For example, a person adds many Images to be published. It can add 4 images, so you can add 10,15,1,3 and so on. How would you look for QUERY ? Form POST Array: array ( [IMG1] => /img/nomedaimagemquefoiupload1.jpg [IMG2] => /...
asked by 12.07.2015 / 01:59
2
answers

Pass value typed to another method

I'm having a question about passing a typed value. I'm posting here because I stayed the whole afternoon yesterday and did not find anything. In 1st class: public class CompararLogin { private String nome; public String cpf; Scanner scan...
asked by 10.06.2015 / 14:21
2
answers

Add a login field to existing users table

What would be the best way to add a login field to an existing database table with more or less 10,000 users. I am currently using MySQL and would like to give a remodeled user table, at the moment the table contains name, email, password, and...
asked by 05.03.2015 / 06:31
2
answers

How to sum a field of a certain ID with multiple records?

Thestorygoeslikethis:apoliticiancanbevotedonforseveral%of%,sothereasonforthesame%candidate%containmultiplerecordswithinthetable.ThezonasbeingID,hehaving6recordsinthedatabasereferringtothe6differentzoneshereceivedvotes.HowtosetupaID_CANDIDATOthat...
asked by 06.03.2015 / 21:24
1
answer

Searching a term in more than one table field

How can I search a term in more than one field of a table in MySQL? For example, I have a website from a furniture store and the customer can search for the term "chair" and that term is in the description, summary, and detail fields, I would li...
asked by 27.10.2014 / 20:53
2
answers

Order for quantities of days missing to win

I have this script in my code: $sql = "SELECT * FROM os WHERE status2 <> 'Fechado' ORDER BY XXXXXXX "; $resultado = mysql_query($sql) or die ("Erro na consulta"); while ($linha = mysql_fetch_assoc($resultado)) { $vencimento = $linha["...
asked by 19.01.2015 / 23:53
2
answers

How to use INNER JOIN?

I have a table called event and another category call I need to count amount of categories coming from event->category_id , but I need db to understand and read the category. TABELAS **event** |**Category_id** || TABELA ||**Catego...
asked by 02.11.2016 / 21:09
2
answers

How to import data from ACCESS to MYSQL

I have db ACCESS with many tables and lots of data registered, I need to import these tables to my new db into MYSQL . Does anyone know a shape? or a tutorial to follow? I'm using MySQL-Front and phpMyAdmin to do th...
asked by 28.10.2016 / 17:28
1
answer

How to import database into Django models?

I have an application that is almost ready. It was developed in PHP through the Laravel Framework. I already have the database and all some data already entered to perform tests. However, since I'm doing some tests with the Django framewor...
asked by 02.05.2016 / 02:13