Questions tagged as 'mysql'

1
answer

MySQL ERROR - # 1452 - Can not add or update a child row

I have the following tables: CREATE TABLE IF NOT EXISTS 'vagas' ( 'id' int(10) unsigned NOT NULL AUTO_INCREMENT, 'empresa' varchar(255) COLLATE utf8_unicode_ci NOT NULL, 'funcao' varchar(255) COLLATE utf8_unicode_ci NOT NULL, 'qnt_vaga...
asked by 09.02.2015 / 18:46
1
answer

Do not display expired expiration banner banner

I'm trying to show on my site banner's that are not expired due date, I have in my bank a banner with the following dates: The current date is: 2015-02-07 Expiry date: 2015-02-08 The script I wrote looks like this:  <?php if ($...
asked by 08.02.2015 / 00:04
2
answers

Search in a field with JSON encoding

There is a field in the table where the content before it is written is encoded in JSON. Content is written as follows: [["nome_completo","Ana Concei\u00e7\u00e3o Dias"],["idade","27 anos"],["cidade","Lisboa"]] In PhpMyAdmin, the select...
asked by 23.01.2015 / 20:26
1
answer

Database with problems for accentuation [duplicate]

The Mysql bank did not support accenting, I changed the encoding to the utf8_general_ci pattern and now started to display the data correctly on the client, but even then the words are bogged down like you get yourself, and if I try to make an...
asked by 13.04.2015 / 04:09
1
answer

Querying in mysql with php does not return result in queries with accents

Hello, I have a system in php / mysql using zend 1.12, but when I query the mysql database with a word that does not have an accent and the table has an accent, it does not return any results, for example: When searching: {joao} and in the da...
asked by 10.04.2015 / 22:02
1
answer

Encrypt password and log in PHP and PDO

Login.php file <?php session_start(); require_once '../includes/config.php'; if(isset($_REQUEST["post_back"])){ $tb = $conn->prepare("select nm_usuario, imgPerfil, nome from usuario where nm_usuario=:usuario and s...
asked by 28.12.2014 / 04:27
1
answer

Optimize SQL Query on three tables

I have a product table that has a foreign key that is the category and a table that stores the name of the product photos. I usually make two queries: one to retrieve the category name and some product fields and another to collect an image of t...
asked by 26.12.2014 / 22:49
2
answers

Working with hierarchical data

I'm creating a system where administrators will set user permissions. As I want to do in an organized and well detailed way, I thought of creating permissions by groups, hierarchically, like this:    Item 1    Register    Change    Delete...
asked by 31.05.2015 / 00:15
1
answer

PHP- Show query results in a select

I made an input for admin to write a message to a specific user. The user will be selected by a select who will fetch the users table from the names and list them all. After selecting someone, the admin can write the message, which would be save...
asked by 09.05.2015 / 22:09
1
answer

Improve SQL query performance accounting for other table records

I have an E-learning system and I need to create a report to return how many students were approved, disapproved, students who have not accessed for more than 30 days, students who are taking the course and those who have not yet attended. Th...
asked by 05.12.2014 / 21:40