MySQL Forums
Forum List  »  PHP

Re: PHP noob. Creating Login.php
Posted by: D F
Date: August 17, 2016 03:23PM

I'm using Notepad++ and XAMPP.


So my tables are in a file called "employee.sql" my full project is called "phpproject.sql", these were both downloaded while using phpMyAdmin (where they were created). I've downloaded them both, I put them into my project FILE called "PHPproject".

DF_Employee.php is basically like a page, the coding is:



<?php

$con = mysqli_connect("localhost", "root", "");
if ( mysqli_connect_errno() != 0)
{
die("An error occurred trying to establish a connection: " .mysqli_connect_error());
}

$db = mysqli_select_db ($con , "PHPproject");
$sqlString = "SELECT Emp_ID, Emp_Fname, Emp_Lname, Emp_Password, Emp_email FROM Employee";
$rs = mysqli_query ($con , $sqlString);

include ("menu.php");
?>
<!DOCTYPE html>
<html>
<head>
<title> DF_Employee.php </title>
</head>
<body bgcolor="#88ccaa">
<br/><br/>
<center>
<table border="0" width="500">
<tr bgcolor=#88ccaa>
<th colspan=15>
<h3>Employee List</h3>
</th>
<tr bgcolor=#88ccaa>
<th align=center>
Employee ID
</th>
<th align=center>
Employee First Name
</th>
<th align=center>
Employee Last Name
</th>
<th align=center>
Employee Password
</th>
<th align=center>
Employee Email
</th>

</tr>

<?php
// While there is another record in the result object, fetch it
while ($row = mysqli_fetch_array ($rs))
{
echo("<tr bgcolor=#88ccaa><td align=center>");
echo($row["Emp_ID"]);
echo("</td><td>");
echo($row["Emp_Fname"]);
echo("</td><td>");
echo($row["Emp_Lname"]);
echo("</td><td>");
echo($row["Emp_Password"]);
echo("</td><td>");
echo($row["Emp_email"]);
?>
</td>
<td>
<a href=DF_EmployeeEditForm.php?sid=<?php echo($row["Emp_ID"]); ?>>Edit</a>
</td>
<td>
<a href=DF_EmployeeDelete.php?sid=<?php echo($row["Emp_ID"]); ?>>Delete</a>
</td>
</tr>
<?php
}
// Destroy the result object and release its memory
mysqli_free_result($rs);

// Close the connection
mysqli_close($con);
?>
<tr bgcolor=#88ccaa>
<td align=center colspan=15></br></br></br>
<a href="DF_EmployeeAddForm.php">Add New Employee</a>
</td>
</tr>
</table>
</center>
</body>
</html>

_______________________________________________________________________

Is any of this relevant so far? I'm sorry, I'm not too savvy with this stuff.

Options: ReplyQuote


Subject
Written By
Posted
D F
August 17, 2016 01:01PM
Re: PHP noob. Creating Login.php
D F
August 17, 2016 03:23PM
D F
August 17, 2016 09:23PM


Sorry, you can't reply to this topic. It has been closed.

Content reproduced on this site is the property of the respective copyright holders. It is not reviewed in advance by Oracle and does not necessarily represent the opinion of Oracle or any other party.