Guest User

Untitled

a guest
Jun 25th, 2018
106
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.88 KB | None | 0 0
  1. <?php
  2. $id = $_GET['id'];
  3. $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";
  4. echo $sql;
  5. $result = mysql_query($sql) or die(mysql_error());
  6. $row = mysql_fetch_assoc($result);
  7.  
  8. // put update_id in hidden form and pass it to the next page
  9. $u_id = $row['u_id'];
  10. ?>
  11. <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>
  12. <h4><b>Posted on: </b> <? echo $row['date_submitted'] = date("F j, Y, g:i a"); ?></h4>
  13.  
  14. $sql = "SELECT
  15. updates.u_id AS u_id,
  16. updates.date_submitted AS date_submitted,
  17. updates.deadline AS deadline,
  18. updates.description AS description,
  19. updates.priority AS priority,
  20. pages.page_name AS page_name,
  21. clients.fname AS fname,
  22. clients.lname AS lname,
  23. projects.p_url AS p_url,
  24. projects.p_title AS p_title,
  25. 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";
  26.  
  27. $id = intval($_GET['id']);
  28.  
  29. $sql = "SELECT clients.fname, clients.lname, projects.p_url, projects.p_title, updates.date_submitted ".
  30. "FROM updates ".
  31. "INNER JOIN clients ON updates.c_id = clients.c_id ".
  32. "INNER JOIN pages ON updates.page = pages.p_id ".
  33. "INNER JOIN projects ON updates.p_id = projects.p_id ".
  34. "WHERE updates.u_id='$id' ".
  35. "LIMIT 1";
  36.  
  37. <? echo $row['date_submitted'] = date("F j, Y, g:i a"); ?>
  38.  
  39. updates.u_id
  40. clients.c_id
  41. ...
  42.  
  43. SELECT updates.u_id AS u_id, pages.page_name AS page_name, ...
  44. FROM updates JOIN client ...
Add Comment
Please, Sign In to add comment