Questions tagged as 'mysql'

1
answer

Select subtraction in columns of different tables

I've been trying to perform a select that subtracts one column from one table to another column from another table. Look at the image below what I need: Therefore, I need to add the quantidade column of the lista_geral tab...
asked by 18.10.2017 / 15:38
1
answer

Checkbox completed

I have a script that the user enter the ID, the fields are completed: name and inactive, if the user has marked the checkbox inactive when registering return the filled checkbox and if he has not checked the checkbox return it without checked, h...
asked by 11.10.2017 / 16:27
1
answer

Insert data tuple into the same database cell

I have the following script: import pymysql cobertura = (10, 20) base_de_dados = pymysql.connect("localhost", "root", "senha", "base_de_dados") cursor = base_de_dados.cursor() cursor.executemany("INSERT INTO individuo VALUES (NULL, %s)", (cob...
asked by 11.10.2017 / 19:57
1
answer

Get information using a dropdownlist as select

I need to make a basic fuel system, where when I select the type of fuel, it brings me the last registered value of that product and automatically selects and automatically inserts the value of the fuel in the TextBox. The supply table is onl...
asked by 10.10.2017 / 21:27
1
answer

Query to count how many fields equal to 0 a record has

I need to return as many fields as 0 each record has and rank the one with the zeros down. Example: id | col2 | col3 | col4 1 | 1 | 0 | 0 2 | 0 | 0 | 0 3 | 0 | 1 | 4 4 | 0 | 3 | 5 5 | 3 | 2 | 40...
asked by 17.11.2017 / 16:54
2
answers

Security failure (PHP, JS, API, MYSQL)

I made a site with login, registration, and so on. I validated the login and the registration with POST method, the site is on the server and everything, but when I put the url link already from inside the page it loads. Is it some mistake I may...
asked by 17.11.2017 / 14:24
1
answer

Send data without refresh PHP [closed]

I have a form with n tables involved and needed to leave all the insert in a single file, well this I already have. But I need it to be sent without refresh and for this I am using ajax. Here's the question how to do this in ajax, in a way that...
asked by 27.09.2017 / 19:14
1
answer

Error executing mysqli_query () on BD Select [duplicate]

When I am going to register something in the database of this PHPcode <?php session_start(); include_once("../seguranca.php"); include_once("../conexao.php"); $nome_nivel = $_POST["nome_nivel"]; $query = mysqli_query("INSERT...
asked by 03.11.2017 / 10:59
1
answer

How to make foreign key one-to-many in mysql?

I have a student table and a table courses, my table courses have the course eg administration, how do I relate several student to this table using Foreign key?     
asked by 04.11.2017 / 02:12
1
answer

Script under 18

I am making a registration that is only allowed for people over 18, I made a script that is catching two days ahead in the case today and day 02/11/2017 then only users who were born on 02/11/1999 to low can register only that in this script I d...
asked by 02.11.2017 / 14:44