Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- function connect() {
- $host = '';
- $user = '';
- $pass = '';
- $db = '';
- $connect = mysqli_connect($host,$user,$pass,$db)
- or die('Failed to connect to db');
- return $connect;
- }
- function showReminder($sock,$user) {
- ## connect and check for reminders else return No reminders.
- ## call delete()
- $string = "SELECT * FROM `table` WHERE user = `$user`";
- $query = mysqli_query($sock,$string)
- or echo "Failed to get notifications\n";
- echo ("
- <table width=\"90%\" border=\"0\" align=\"center\">
- <tr>
- <td colspan=\"3\">List Of Reminder</ td>
- </ tr>
- ");
- while ($results = mysqli_fetch_array($query)) {
- $id = results["id"];
- $title = $results["title"];
- $description = $results["description"];
- $date = $results["date"];
- $prior = $result["prior"];
- echo ("
- <tr>
- <td width=\"40%">$title</td>
- <td width=\"30%\">$date</td>
- <td width=\"10%\">$prior</td>
- <td width=\"10%\"><a href=\"setReminder.php?id=$id> delete </a > </ td>
- </tr>
- ");
- }
- }
- function delete($sock) {
- ## Check if "id" is passed to the page and delete it
- $id = $_GET["id"];
- if (!empty($id)) {
- $string = "DELETE FROM `table` WHERE id = mysqli_real_escape_string($sock,$id)";
- $query = mysqli_query($sock,$string);
- }
- }
- ?>
Add Comment
Please, Sign In to add comment