Advertisement
Guest User

Untitled

a guest
Aug 25th, 2016
83
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.86 KB | None | 0 0
  1. <?php
  2. header('Content-type: text/html; charset=utf-8');
  3.  
  4. $db_host="";
  5. $db_user="";
  6. $db_password="";
  7. $db_name = "";
  8. $mysqli = new mysqli($db_host, $db_user, $db_password, $db_name);
  9. if (mysqli_connect_errno()) {
  10. printf("Ошибка соединения: %sn", mysqli_connect_error());
  11. exit; }
  12. $mysqli->set_charset("utf8");
  13. if ($stmt = $mysqli->query('SELECT * FROM vtiger_contactdetails, vtiger_timesheet, vtiger_timesheetcf WHERE vtiger_contactdetails.contactid = vtiger_timesheet.cf_2295 AND vtiger_timesheet.cf_2295 = vtiger_timesheet.timesheetid')) {
  14.  
  15. while($row = $stmt->fetch_assoc()){
  16. echo $row['lastname'].' '.$row['cf_2295'].'<br />';
  17. }
  18. }
  19.  
  20. ?>
  21.  
  22. SELECT * FROM vtiger_contactdetails
  23. JOIN vtiger_timesheet
  24. ON vtiger_contactdetails.contactid = vtiger_timesheet.cf_2295
  25. JOIN vtiger_timesheetcf
  26. ON vtiger_timesheet.cf_2295 = vtiger_timesheet.timesheetid
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement