Questions tagged as 'query'

1
answer

How to return an answer from sql?

This is my first post in a forum, so I apologize if I make a mistake. This is the following, I need to register a book in the bank, but before that, I would need to know if the author is already registered in the bank, or if not, I must regis...
asked by 01.06.2018 / 05:18
1
answer

How to make an INNER JOIN in a single table with 3 keys?

I have a table that has the following structure: origem|papel|campo018|campo040|mercado|Master_key| The Master_key column can have two values: 'NY' OR 'MS' , I'd like to compare the rows in which Master_key is equal to...
asked by 19.06.2018 / 20:49
1
answer

Bring column values and sum total with php + mysql

I have the following script that brings the values I need, how do I also bring the total sum of $ row ['value']? $results = $mysqli->query("SELECT * FROM cv_contratos_dependentes WHERE idcontrato = $idcontrato"); //get all records from add_...
asked by 11.12.2017 / 17:03
1
answer

Show MySQL Query Result with Echo (PHP)

I have a script in PHP and MySQL that has a query responsible for counting how many records (clients) are inserted into one of the tables in my database. However, I need to show the amount of records (clients) in the table with the echo command,...
asked by 25.12.2018 / 18:37
2
answers

Sql auction script [closed]

I need to make an application for a used things auction company, so I need to create an interface where n clients can bid a minimum and a maximum bid for a X product and the system returns the winner, but making a rule for the customer to pay...
asked by 07.02.2017 / 00:53
1
answer

Query php does not show expected result

I have here a problem with a query because I ask to show all the fields that a certain condition that in a column is written 'Lisbon', but the result is: Lisbon and port. Query: Select * From tb_trabalhador WHERE (AlvaraNumero = 0 or Alvar...
asked by 11.04.2014 / 11:09
1
answer

How to return the id of the user who is in the session

require_once('conexao.php'); @$email = $_POST['email']; @$senha = md5($_POST['senha']); // $email = "[email protected]"; // $senha = "12346"; $pdo = $dbconn->prepare("SELECT userid, nome, nivel FROM usuario WHERE email=:email and senha=:...
asked by 17.03.2018 / 23:13
1
answer

My SQL Query does not work correctly?

I have a system that uses dates for logging and I separate the date by an arrays-formed explode and register them in a database, but when I do the query it looks for them in order, the order stumbles. Following code examples - >...
asked by 14.11.2018 / 02:49
2
answers

Query does not return fetch_array

I'm trying to make a query though, although the query works fine in PHPMyAdmin in the browser it returns the message below:    Fatal error: Call to undefined method PDOStatement :: fetch_array () in   D: \ xampp \ htdocs \ final \ inc \ proje...
asked by 25.01.2018 / 13:26
3
answers

How to make an INNER JOIN bringing everything from two tables and one more "max" in a specific field?

Good people, to be more specific I have two tables. table 01: ...andtable02: ...andIwouldliketodoa"select" bringing all of these two tables, but where in the "dots" field (table 02) you have the highest number of points, how to do that? Eg...
asked by 16.11.2017 / 11:50