HELP PLEASE

nabile

New Member
Joined
Aug 26, 2020
Messages
2
Reaction score
1
Credits
42
Hello i am new
I have a 'lamp' project to do. I am new and my project is quite simple.
A library to register students, books and that each student can borrow a book.
I created a database with three tables
students, books and loans
I managed to enroll the students in the books.
The student table has a ClientID (primary key), as well as the books table (BookRef). They are linked to the loan table.
When I inject the data into the checkout table, I get no error messages, but nothing is logged.
index.borrow table:
! DOCTYPE html>
<html>
<head>
<title> Loan page </title>
</head>
<body>
<div align = "center">
<h1> Registration </h1>
<h2> Please enter your contact details </h2>


<style>
body {
box-shadow: 1px 6px 17px;
margin-right: 35%;
margin-left: 35%;
margin-top: 20%;
padding-top: 20 px;
padding-bottom: 10px;
}
.btn {
withd: 100px;
}
</style>

<html>
<div class = "form-group">
<label id = "senderName"> Students </label>
<select name = "student">;
<? php
$ con = mysqli_connect ("localhost", "fred", "poseidon", "class");
$ sql = mysqli_query ($ con, "SELECT * from students");
$ row = mysqli_num_rows ($ sql);
while ($ row = mysqli_fetch_array ($ sql)) {
echo "<option value = '". $ row ['Name']. "'>". $ row [' Name ']. "</option>";
echo "<option value = '". $ row ['IdClient']. "'>". $ row [' IdClient ']. "</option>";
}
?>
</select>
</div>
</html>

<div class = "form-group">
<label id = "senderName"> Title </label>
<select name = "Title">;
<? php
$ con = mysqli_connect ("localhost", "fred", "poseidon", "class");
$ sql = mysqli_query ($ con, "SELECT * From books");
$ row = mysqli_num_rows ($ sql);
while ($ row = mysqli_fetch_array ($ sql)) {
echo "<option value = '". $ row ['IdClient']. "'>". $ row [' IdClient ']. "</option>";
}
?>
</select>
</div>

<div class = "form-group">
<label for = "dateOutput"> Date Out </label> <br>
<input type = "date" name = "output_date" id = "output_date" class = "form-control date";

</div>
<div class = "form-group">
<label for = "Renderdate"> Render Date </label> <br>
<input type = "date" name = "date_rendu" id = "date_rendu" class = "form-control date";
</div>

<div align = "center">
<td align = "center"> <input class = "btn" type = submit name = "Validate" value = "OK"> </td>
</div>

</form>
</table>
</form>
</body>
</html>

borrowing.php file

<? php
$ conn = mysqli_connect ("localhost", "fred", "poseidon", "class") or die (mysqli_error ());
$ BookRef = $ _ POST ['BookRef'];
$ IdClient = $ _ POST ['IdClient'];
$ exit_date = $ _ POST ['exit_date'];
$ render_date = $ _ POST ['render_date'];
$ req = "INSERT INTO loan (BookRef, CustomerID, output_date, rendering_date) VALUES ('$ BookRef', '$ CustomerID', '$ output_date', $ rendering_date ')";
$ res = mysqli_query ($ conn, $ req);
?>
<! DOCTYPE html>
<html>
<body>
<! DOCTYPE html>
<html>
<body>
<form>
<div align = ”center”> <h3> the loan </h2>
<table align = ”center” ”>
<tr>
</tr>
</table>
<p> is well registered </p>

<p> <a href="index.emprunt.php"> add a new LOAN </a> </p> </div>

<p> <a href="index.html"> BACK TO HOME </a> </p> </div>
</form>
</body>
</html>
thanks in advance
 


If you're trying to view query log, edit in my.ini

general_log_file = /path/to/query.log
general_log = 1

then restart mysql service
 
Hello,

I solved the problem. It was problems with writing, syntax, my "PHP" requests in my file.
Thank you so much.
 

Members online


Top