Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- /*
- Template Name: Timesheet
- */
- get_currentuserinfo();
- global $current_user;
- get_currentuserinfo();
- echo 'Logged In User: ' . $current_user->user_login . "\n";
- ?>
- <br>
- <?php
- $username="User";
- $password="Pass";
- $database="Database";
- mysql_connect(localhost,$username,$password);
- mysql_select_db($database) or trigger_error( mysql_error() . " Unable to select database");
- ?>
- <select name="Projects">
- <?php
- $sql = "SELECT ProjectName, ProjectID FROM Projects".
- "ORDER BY ProjectName";
- $rs = mysql_query($sql) or trigger_error(mysql_error() . " unable to run query.");
- while($row = mysql_fetch_assoc($rs))
- {
- echo "<option value=\"".$row['ProjectName']."\">".$row['ProjectID']."</option>\n ";
- }
- ?>
- </select>
Add Comment
Please, Sign In to add comment