Questions tagged as 'mysql'

1
answer

Database Versioning [duplicate]

I use Git % + SourceTree for versioning and project sharing with other members of esquipe. But we have some problems related to the Database. Is it possible to share it? As for example commit BD and then pull by another user?     
asked by 28.06.2016 / 15:52
1
answer

error Recoverable fatal error: Object of class mysqli_result could not be converted to string

I am not able to save the Id of the address in the database, I do a select of the address but I can not <?php session_start(); $host = "localhost"; $user = "root"; $senha = ""; $banco = "cafeteriasp"; $conexao = mysqli_connect ($host, $u...
asked by 04.12.2017 / 14:38
2
answers

Warning: mysql_num_rows () expects parameter 1 to be resource, boolean given in [duplicate]

I have a problem with the mysql_num_rows ()    "Warning: mysql_num_rows () expects parameter 1 to be resource, boolean   given " I've been browsing other posts but none could help me. PHP looks like this: //Sistema de paginação $sql...
asked by 01.10.2015 / 19:48
3
answers

Return the row of a table when the value of count (field) is 0 in MySQL

I need that even when the search does not generate results, the value 0 is displayed, I tried with the following SQL search, but without success: SELECT c.categoria as categoria, CASE WHEN COUNT(c.categoria) IS NOT NULL THEN cou...
asked by 11.03.2018 / 02:25
1
answer

Working with dates from MySQL / PHP

Inside a select in the bank, I look for the expiration date of the product. I need it to be calculated by changing a status in the 'beat', 'critical', and expired 'response. I'm trying to do it this way below, but I'm kind of rusty....
asked by 23.02.2018 / 15:16
3
answers

Repeat loop json php mysql

I get a json via post php, and I want to insert the information into a table in the mysql database .. json{ { "todos": [{ "nome0": "andre", "cor0": "preta" }, { "nome1": "felipe", "cor1": "azul" }, { "nome2": "laura", "cor2": "rosa" } ] }...
asked by 16.03.2018 / 14:48
1
answer

MYSQL: ERROR 2027 (HY000): Malformed packet

I can not connect to a MySQL server remotely. The connection seems to be ok because with telnet [ip] [port] I get response: 4.1.3b-beta-nt-max▒@mysql -u[user] -p -h [host]v'[uZ,B{efSLa$,Q4N When run by command line or MySQL 6.3 Workbench 4...
asked by 12.08.2017 / 21:15
1
answer

How to return data array with join in Laravel with DB class?

I need help with this SQL of Laravel : $process = $db->table('processo')->where('nrprocesso',$id) ->leftJoin('viatransporte', function($viatransporte){ $viatransporte->on('processo.idviatransporte', '=', 'viatra...
asked by 19.03.2017 / 16:03
1
answer

group per SQL query

I have a post table with a category field, each post you enter can get more than one category: post1 categoria1, categoria2 post2 categoria1, categoria3 How can I perform a sql query to join the duplicate categories and...
asked by 28.02.2017 / 19:48
1
answer

List the owner of the post and the last user who commented. Mysql

Hey guys, I have the following query below, where I list all posts, number of comments and the user who created it, but also wanted to list the last user who commented on each post, can you do all this in just a query? SELECT post.titulo, COUN...
asked by 05.02.2017 / 15:07