Questions tagged as 'mysql'

1
answer

Relationship N: N in Laravel does not write object attributes

My tables briefly have the following structure: minutes: id | vigencia Products: id | nome | descricao ata_producto: ata_id | produto_id | vlr_produto | qtd_produto The same product may have different value depending on t...
asked by 13.09.2015 / 20:23
1
answer

ERROR "Call to a member function setCode () on a non-object in" [closed]

Programming is in object-oriented php and MVC. I am making a user registry and saving it in the database, however the following error appears:    Call a member function setCode () on a non-object in What is causing this error? if ($_...
asked by 13.09.2015 / 19:06
1
answer

How to count equal items from 5 different columns?

I have a table so . The table stores the attendance record ( P ) and faults ( F ). I need to tell, for example, how many presences and how many faults a particular code has.     
asked by 01.09.2015 / 00:18
1
answer

Create MySQL user and database via PHP

1 - Is it possible to create new MySQL user and database via PHP script? 2 - If so, would it involve any such security risk? Objective: I have a system running (CMS itself) where the user does almost everything to activate on the serve...
asked by 18.10.2015 / 12:19
1
answer

Problem When printing a SQL query on the PHP page

I have a SQl query and my code is printed only the first line of the query, does anyone have any idea what my problem might be?    ERROR: Warning: mysql_fetch_assoc () expects parameter 1 to be resource, <?php include ("conexao.php...
asked by 16.10.2015 / 22:39
1
answer

How do I connect to the database via [WordPress] to consult?

Well, I have a call jQuery Ajax on header.php of my theme that is entering a PHP file in the root of my Wordpress and returning me echo test. I need this file to query the banco de dados and return me so...
asked by 29.07.2015 / 22:48
1
answer

How to reduce the INSERT script in DB with PDO - bindValue?

Some way to shorten this script ?? Or every time I make a INSERT in the database using PDO and the bindValue function, will I have to write row by line ?? Or you can use an array or something faster and easier. //Prepara o ca...
asked by 04.02.2016 / 16:27
1
answer

How to configure and verify MySQL to improve perfomance

How to configure the MySQL server for better performance in terms of memory usage, processing, and cache usage where the machine has limited resources? Is there a tool that can help me define the best settings for my server? I am having probl...
asked by 18.11.2015 / 04:50
1
answer

Inserting IMG into Mysql

The code I am using is giving some error that I can not identify; If I select the image X upload normally happens, but if I select the image Y the system simply does not insert and does not give any error. // Edit [out of nowhere the bl...
asked by 21.07.2015 / 15:01
1
answer

INNER JOIN Group Too slow in the query

I have a select in mysql that is taking a long time to return the records, I noticed that this happens after the table gets fuller. This select makes 4 INNER JOINS and takes the last record of each id belonging to the id_motorist column with...
asked by 27.09.2015 / 03:08