-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathindex.php
More file actions
29 lines (28 loc) · 1.08 KB
/
Copy pathindex.php
File metadata and controls
29 lines (28 loc) · 1.08 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
<?php
$db = mysqli_connect('student.cs.appstate.edu', 'fenwickgg', '900556709', '5450net') or die("Error connecting to MySQL server.");
?>
<html>
<body>
<h3>Welcome!</h3>
<p>Our database info is: TBD</p>
<form action="login.html">
<input type="submit" value="Login" >
</form>
<form action="signup.html"><input type="submit" value="Sign up"></form>
<p>The number of users we have is: <b>
<?php $query = "SELECT COUNT(*) FROM Users";
mysqli_query($db, $query) or die('Error querying database.');
$result = mysqli_query($db, $query);
$res = mysqli_fetch_row($result);
$num_rows = $res[0];
echo "$num_rows people"
?> </b></p>
<?php $query = "SELECT COUNT(*) FROM Users";
mysqli_query($db, $query) or die('Error querying database.');
$result = mysqli_query($db, $query);
$res = $mysqli_fetch_row($result);
echo "$res people"
?>
<script src="scripts/main.js></script>
</body>
</html>