Click here to Skip to main content
15,919,028 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
I need to complete the code where the ellipsis are.

What I have tried:

if (isset($_GET['solicitar'])) {
    $sql7 = "INSERT INTO emissao_certificados (id_usuarios, id_curso, data_solicitacao, status, nome, rua, numero, bairro, cidade, estado, cep) VALUES ('".$_SESSION['usuarioId']."','".$_GET['id']."','".date('Y-m-d')."','Aguardando', ... )";
    $query7 = mysqli_query($mysqli, $sql7);
    header("Location: cursos-aluno.php?solicitado");
}
Posted
Updated 14-May-19 20:34pm
Comments
phil.o 15-May-19 2:53am    
Are you aware that having your homework done by someone else defeats the very purpose of this homework?

We don't know, and we can't know: we have absolutely no idea what your app is meant to do, what data it processes, how it is meant to process it, what your DB looks like, or what results you expect.

Go back to wherever you got the code fragment from, and ask there - they may have an idea what you are trying to achieve, but we don't!
 
Share this answer
 
Quote:
How do I complete the following PHP code after the word 'aguardando'?

And we are supposed to know what you try to do?
My wild guess is that you want to provide the value for field 'nome', then for 'rua'.
PHP
$sql7 = "INSERT INTO emissao_certificados (id_usuarios, id_curso, data_solicitacao, status, nome, rua, numero, bairro, cidade, estado, cep) VALUES ('".$_SESSION['usuarioId']."','".$_GET['id']."','".date('Y-m-d')."','Aguardando', ... )";

Not a solution to your question, but another problem you have.
Never build an SQL query by concatenating strings. Sooner or later, you will do it with user inputs, and this opens door to a vulnerability named "SQL injection", it is dangerous for your database and error prone.
A single quote in a name and your program crash. If a user input a name like "Brian O'Conner" can crash your app, it is an SQL injection vulnerability, and the crash is the least of the problems, a malicious user input and it is promoted to SQL commands with all credentials.
SQL injection - Wikipedia[^]
SQL Injection[^]
SQL Injection Attacks by Example[^]
PHP: SQL Injection - Manual[^]
SQL Injection Prevention Cheat Sheet - OWASP[^]
How can I explain SQL injection without technical jargon? - Information Security Stack Exchange[^]
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900