Questions tagged as 'mysql'

1
answer

Multi-table query Node + Mysql

Considering the need to bring the result of a second table, based on the result of the first one, how would you do it with NodeJS? In PHP I would bring the result, and within while I would make another query by passing the ID of the first...
asked by 29.08.2017 / 02:57
3
answers

MySQL - join results from several columns

I have a MySQL table where I need in a single result fields that are in 3 different columns. I'll give you an example: Col.A Col.B Col.C Joaquim Sérgio Ricardo Ricardo Maria César Rafael Solange...
asked by 23.03.2017 / 19:01
2
answers

How to execute create mysql database using shell script if base name has "-"

On the server there are some databases named modelo-submodelo (this is the name of the database, created with "-" same). When I execute a command like: mysqldump -h"$DBHOST" -u"$DBUSER" -p"$DBPASS" modelo-submodelo --compress=TRUE &g...
asked by 29.03.2017 / 15:30
1
answer

SQL date filter on timestamp

I have the following query: SELECT name, commission, timestamp, state_name FROM magry_awoaffiliate_commission c INNER JOIN magry_users u ON (c.user_id = u.id) INNER JOIN magry_virtuemart_userinfos v ON (c.user_id = v.virtuemart_user_id) INNER...
asked by 30.03.2017 / 21:42
1
answer

How to use LIKE in bindValue?

How to use the % operator, for bindValue() , on query below: $sql = 'SELECT * FROM nfe WHERE (cliente LIKE :cliente OR :cliente_ IS NULL)';     
asked by 26.02.2017 / 01:00
1
answer

2 FK for a 1 PK

I want to connect the 2 FK of the credit card and bank slip table to the payment table of the Payment ID plus the following error appears:    Error Code: 1022. Can not write; duplicate key in table '# sql-900_e' I have no idea how i...
asked by 14.02.2017 / 18:44
1
answer

Sending Data via Link (POST or GET)

Good morning my dear ones, I'm new here ... First of all, I want to point out that I already read the topics that exist in this forum and I could not solve my problem! My problem is to send only the id of the bank from one PHP page to anot...
asked by 18.02.2017 / 12:44
2
answers

Query delete with Join mysql

I have a problem with this query, I do not know what's wrong: DELETE FROM mdl_forum_discussions WHERE id IN ( SELECT mdl_forum_discussions.id FROM mdl_forum_discussions LEFT JOIN mdl_forum_posts ON mdl_forum_discussions.id = mdl_for...
asked by 14.02.2017 / 18:01
2
answers

How to sort a select with 2-in-2 results

I am creating a system where the user informs the name and time of birth. I wonder if you can solve the following question: I have the following table: Havingthenameandtimeofbirth,thesystemadministratorinformsthepriorityofeachrecord,being:1=...
asked by 01.03.2017 / 18:07
1
answer

PDO exec returning false

I'm doing an online course on PHP with PDO and I'm having trouble right away in the first class, with the code: <?php $pdo = new PDO('mysql:host = localhost, dbname = curso_php_oop', 'root', ''); //instanciando a classe do PDO, iniciando c...
asked by 06.03.2017 / 17:38