Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
F
F1-Website
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
suleman.hussain
F1-Website
Commits
38a91368
Commit
38a91368
authored
Jan 25, 2023
by
suleman.hussain
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Replace drivers.php
parent
a4e8c11c
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
41 additions
and
23 deletions
+41
-23
drivers.php
drivers.php
+41
-23
No files found.
drivers.php
View file @
38a91368
...
...
@@ -3,40 +3,21 @@
<body>
<?php
// Connects to database
$conn
=
mysqli_connect
(
"ysjcs.net"
,
"suleman.hussain"
,
"WF8L8LE8"
,
"sulemanhussain"
);
if
(
!
$conn
)
{
die
(
"Connection failed: "
.
mysqli_connect_error
());
}
$sql
=
"SELECT * FROM Drivers"
;
$results
=
mysqli_query
(
$conn
,
$sql
);
// Table
if
(
isset
(
$_POST
[
'search_f_name'
]))
{
echo
"<table>"
;
echo
"<tr>"
;
echo
"<th>First Name</th>"
;
echo
"<th>Last Name</th>"
;
echo
"<th>DoB</th>"
;
/*
echo
"<th>Nationality</th>"
;
echo
"</tr>"
;
while($row = mysqli_fetch_assoc($results)){
echo "<tr>";
echo "<td>" . $row["First_Name"]. "</td>";
echo "<td>" . $row["Last_Name"]. "</td>";
echo "<td>" . $row["DoB"]. "</td>";
echo "</tr>";
}
echo "</table>";
*/
if
(
isset
(
$_POST
[
'search'
]))
{
$search_term
=
$_POST
[
'search_term'
];
// Connect to the database
$conn
=
mysqli_connect
(
"ysjcs.net"
,
"suleman.hussain"
,
"WF8L8LE8"
,
"sulemanhussain"
);
// Call the stored procedure
$results
=
mysqli_query
(
$conn
,
"CALL search_
proc
('
$search_term
')"
);
$results
=
mysqli_query
(
$conn
,
"CALL search_
driver_name
('
$search_term
')"
);
// Display the results
echo
"</tr>"
;
...
...
@@ -45,11 +26,41 @@ while($row = mysqli_fetch_assoc($results)){
echo
"<td>"
.
$row
[
"First_Name"
]
.
"</td>"
;
echo
"<td>"
.
$row
[
"Last_Name"
]
.
"</td>"
;
echo
"<td>"
.
$row
[
"DoB"
]
.
"</td>"
;
echo
"<td>"
.
$row
[
"Nationality"
]
.
"</td>"
;
echo
"</tr>"
;
}
echo
"</table>"
;
}
if
(
isset
(
$_POST
[
'search_Nationality'
]))
{
echo
"<table>"
;
echo
"<tr>"
;
echo
"<th>First Name</th>"
;
echo
"<th>Last Name</th>"
;
echo
"<th>DoB</th>"
;
echo
"<th>Nationality</th>"
;
echo
"</tr>"
;
$search_term
=
$_POST
[
'search_term'
];
// Connect to the database
$conn
=
mysqli_connect
(
"ysjcs.net"
,
"suleman.hussain"
,
"WF8L8LE8"
,
"sulemanhussain"
);
// Call the stored procedure
$results
=
mysqli_query
(
$conn
,
"CALL search_nat('
$search_term
')"
);
// Display the results
echo
"</tr>"
;
while
(
$row
=
mysqli_fetch_assoc
(
$results
)){
echo
"<tr>"
;
echo
"<td>"
.
$row
[
"First_Name"
]
.
"</td>"
;
echo
"<td>"
.
$row
[
"Last_Name"
]
.
"</td>"
;
echo
"<td>"
.
$row
[
"DoB"
]
.
"</td>"
;
echo
"<td>"
.
$row
[
"Nationality"
]
.
"</td>"
;
echo
"</tr>"
;
}
echo
"</table>"
;
}
?>
...
...
@@ -70,10 +81,17 @@ echo "</table>";
<form
method=
"post"
action=
""
>
<input
type=
"text"
name=
"search_term"
id=
"search-bar"
placeholder=
"Search Driver First Name"
>
<button
type=
"submit"
name=
"search"
id=
"search-btn"
>
<button
type=
"submit"
name=
"search
_f_name
"
id=
"search-btn"
>
<i
class=
"fa fa-search"
></i>
</button>
</form>
<form
method=
"post"
action=
""
>
<input
type=
"text"
name=
"search_term"
id=
"search-bar"
placeholder=
"Search Nationality"
>
<button
type=
"submit"
name=
"search_Nationality"
id=
"search-btn"
>
<i
class=
"fa fa-search"
></i>
</button>
</form>
</html>
\ No newline at end of file
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment