Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- global $broadcast;
- $lists_arr = ViewList();
- $table = '<table border>';
- $table .= "<th>List Name</th><th>Actions</th>";
- foreach ($lists_arr as $key => $value) {
- switch ($key) {
- case 'listname':
- $list_name = $lists_arr['listname'];
- $table .= "<tr>
- <td>$list_name</td><td>Edit</td><td>Delete</td>
- </tr>";
- break;
- }
- }//close foreach stmt
- //close table
- $table .= "</table>";
- echo $table;
- function ViewList() {
- /*
- * Create a list for this user
- */
- //db handler
- DbHandler();
- $query= "select * from $schema.$tb;";
- $result = pg_query($query);
- if ($result) {
- //return results array
- $res_arr = pg_fetch_array($result);
- return $res_arr;
- } else {
- $message = "Failed to select list";
- $code = 102;
- throw new Exception($message, $code);
- }
- }//close ViewList() fn
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement