Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- $id = $_GET['id'];
- $sql = "SELECT * FROM updates INNER JOIN clients ON updates.c_id = clients.c_id INNER JOIN pages ON updates.page = pages.p_id INNER JOIN projects ON updates.p_id = projects.p_id WHERE u_id='$id' LIMIT 1";
- echo $sql;
- $result = mysql_query($sql) or die(mysql_error());
- $row = mysql_fetch_assoc($result);
- // put update_id in hidden form and pass it to the next page
- $u_id = $row['u_id'];
- ?>
- <h4>Viewing update for <i><? echo $row['fname'] ." ". $row['lname'] ?></i> for their <i><a href="<? echo $row['p_url']; ?>" title="View <? echo $row['p_title']; ?>"><? echo $row['p_title']; ?></a> project</i></h4>
- <h4><b>Posted on: </b> <? echo $row['date_submitted'] = date("F j, Y, g:i a"); ?></h4>
- $sql = "SELECT
- updates.u_id AS u_id,
- updates.date_submitted AS date_submitted,
- updates.deadline AS deadline,
- updates.description AS description,
- updates.priority AS priority,
- pages.page_name AS page_name,
- clients.fname AS fname,
- clients.lname AS lname,
- projects.p_url AS p_url,
- projects.p_title AS p_title,
- FROM updates INNER JOIN clients ON updates.c_id = clients.c_id INNER JOIN pages ON updates.page = pages.p_id INNER JOIN projects ON updates.p_id = projects.p_id WHERE u_id='$id' LIMIT 1";
- $id = intval($_GET['id']);
- $sql = "SELECT clients.fname, clients.lname, projects.p_url, projects.p_title, updates.date_submitted ".
- "FROM updates ".
- "INNER JOIN clients ON updates.c_id = clients.c_id ".
- "INNER JOIN pages ON updates.page = pages.p_id ".
- "INNER JOIN projects ON updates.p_id = projects.p_id ".
- "WHERE updates.u_id='$id' ".
- "LIMIT 1";
- <? echo $row['date_submitted'] = date("F j, Y, g:i a"); ?>
- updates.u_id
- clients.c_id
- ...
- SELECT updates.u_id AS u_id, pages.page_name AS page_name, ...
- FROM updates JOIN client ...
Add Comment
Please, Sign In to add comment