Questions tagged as 'mysql'

1
answer

IF record = X, LEFT JOIN in table 1, IF record = Y, LEFT JOIN in table 2

I have a table called "system_name" containing these fields: - User Type - usuId This user should store a user's ID, obviously. But this user can have 2 types (Student and Client). The data for these students and clients is stored in another...
asked by 06.07.2018 / 18:50
1
answer

Working with multiple or single databases (MySQL)

Hello, guys! One company hired me to unify (and redo) several systems they own. The work is to create single administrative panel for various sectors and products. When thinking about storing the data, I came across the following question...
asked by 30.01.2018 / 15:57
2
answers

PHP returns NULL when information has accents

When I want to display the data returned by a JSON, it returns me NULL . But when the database information is without accents, it returns me normally: <?php include_once 'WSAps_conexao.php'; $cidade =$_POST['cidade']; $sql = $dbcon->q...
asked by 26.11.2017 / 21:41
2
answers

Display ID in form before registering php and mysql

I'm doing a sign-up screen, but I wanted the system to already display the ID (id_entity) that will be registered. When saving, it will ask if I want to register documents, then if I click on yes, it goes to a new doc registration form that when...
asked by 24.12.2017 / 19:26
3
answers

Display more than one information in the same table with PHP and MYSQL

I would like to display in the table the information of the registered student and also of the courses that he is enrolled in. Final result you'd like displayed: Nome Aluno | Telefone Aluno | Cursos ---------------------------------------...
asked by 06.01.2018 / 18:33
3
answers

How to convert date with date to date in select query?

Here is the photo below: Follow the code: select dt_abertura, count(1) as qtd from tabela group by dt_abertura; How to convert date with time (2017-09-23 16:24:55) to date only (23-09-2017) ? I would like to be able to group...
asked by 15.06.2018 / 17:03
1
answer

(PHP) What variable I put inside mysqli_affected_rows

<?php $conexao = mysqli_connect("localhost","root","","banco"); $nome = isset($_REQUEST['nome'])?$_REQUEST['nome']:""; $telefone = isset($_REQUEST['telefone'])?$_REQUEST['telefone']:""; $sql = "insert into tb_banco(nome, telefone)values('$n...
asked by 11.06.2018 / 22:35
2
answers

Add MySQL column with increment not to repeat

My intention is to get a variable via POST and change the value of it. $vem = $_POST['nome']; if (isset($vem)){ $vem = 1; $vem++; $vem = 'campo'.$vem; } I will add as a table column within that change $vem = $_POST['nome']...
asked by 08.06.2018 / 19:54
2
answers

What's wrong with this code to insert data into mysql?

I am trying to make a code to insert data into the localhost database, however I am not able to insert, and I do not know why. My database settings are correct and the tables are also correct. The error for sure is in the code, so I wo...
asked by 03.06.2018 / 23:35
2
answers

Problem passing variable from one screen to another

is as follows. I'm having a problem using $ _SESSION in PHP. I'm starting now, so I'm sorry if I did not login in the right way. I have a Login screen that basically runs this code: <?php session_start(); include_once('classes/...
asked by 08.04.2018 / 19:22