Questions tagged as 'mysql'

3
answers

Display the result of a COUNT in the Database

The PHP code looks like this: $con = new PDO(SERVIDOR, USUARIO, SENHA); $sql = $con->prepare("SELECT COUNT(id) FROM quiz;"); $sql->execute(); $n = $sql->fetchObject(); And the HTML code looks like this: &l...
asked by 28.05.2018 / 23:34
1
answer

How can I enter data into two different tables?

I have created a function to insert information into two different tables, but it is displaying an error:    You have an error in your SQL syntax; ('mary', 2147483647, 'a' at line 2) My role is: function newUser($connect, $name, $reg...
asked by 14.06.2018 / 04:37
0
answers

Bank query problem with Codeigniter

I have a table in the database (use_shopBlock), which blocks a button in the view, but when I give a <?php var_dump($shopBlock);?> the result is NULL . My view: <?php $shopBlock = $this->main_model->...
asked by 25.05.2018 / 16:10
0
answers

Identify type of operation with javascript

How can I identify when the click is "From:" "To:"? I have a code to add a value from a database field, to another field, follow the example: HTML: <div class='row justify-content-center'> <div class="con...
asked by 05.06.2018 / 22:14
1
answer

Group dates that are in MySQL in PHP

I have a table in MySQL called apartamento_data , in it there are dates that the apartment is rented, that is, unavailable for rent. Each row a date, like this: 2017-05-31 2017-06-01 2017-06-04 2017-06-05 2017-06-06 What I need, to...
asked by 05.06.2018 / 18:56
0
answers

Is it worth using index for table in MySQL that stores chat messages? [closed]

Friends, I read several posts about using index in MySQL database tables, their advantages and disadvantages, but I still had a question for my situation. Consider over 300,000 registered users and they can talk to each other when one adds th...
asked by 08.06.2018 / 01:55
0
answers

Generate a Generic String with data from two tables - Codeigniter PHP

I have a little problem. I am developing a system for learning, but one of the requirements that I "invented" myself is to generate a base string. I'll try to drill down. Tenho a tabela **term** com os seguintes campos: term_id term Tenho...
asked by 08.06.2018 / 09:23
1
answer

MYSQL - Latest results when grouping by a certain field

I have the following tables in my MYSQL database USERS Table id | login --------------- 1 | usuario1 2 | usuario2 3 | usuario3 STATUS Table id | idUsuario | data | status 1 | 1 | 2018-05-10 10:00:00 | a 2 |...
asked by 07.06.2018 / 21:58
0
answers

How should I register my passwords in a database? [closed]

I am creating a program in Java, connected to a database, my problem is whether to create a new tab to save the password and the name of each user or if I should use this data as client attributes. Thank you!     
asked by 19.05.2018 / 12:31
1
answer

How to collect the activity execution time performed in the database without executing directly in mysql

I need to get the runtime of several inserts, updates, alter tables between other activity I do in the database, I know that if I did it right in mysql it would return to the end of the operation, but I am executing a script in js for Ba...
asked by 03.06.2018 / 21:52