recordset wrangling
Hi guys
Have set up a page which returns the data from table 'practice_staff' and am trying to tie the column from that table 'StaffPracticeID' with the column 'PracticeName' from another table 'practices' This is basically to show a list of the staff and the shop/practice that they work at
The rs I have so far is
<?php
$maxRows_WADAstaff = 20;
$pageNum_WADAstaff = 0;
if (isset($_GET['pageNum_WADAstaff'])) {
$pageNum_WADAstaff = $_GET['pageNum_WADAstaff'];
}
$startRow_WADAstaff = $pageNum_WADAstaff * $maxRows_WADAstaff;
mysql_select_db($database_PowerCMSConnection, $PowerCMSConnection);
$query_WADAstaff = "SELECT practice_staff.*, practices.PracticeName FROM practice_staff LEFT JOIN practices ON practices.PracticeName = practice_staff.StaffPracticeID AND practices.PracticeName = practice_staff.StaffPracticeID ORDER BY StaffName ASC";
setQueryBuilderSource($query_WADAstaff,$WADbSearch1,false);
$query_limit_WADAstaff = sprintf("%s LIMIT %d, %d", $query_WADAstaff, $startRow_WADAstaff, $maxRows_WADAstaff);
$WADAstaff = mysql_query($query_limit_WADAstaff, $PowerCMSConnection) or die(mysql_error());
$row_WADAstaff = mysql_fetch_assoc($WADAstaff);
if (isset($_GET['totalRows_WADAstaff'])) {
$totalRows_WADAstaff = $_GET['totalRows_WADAstaff'];
} else {
$all_WADAstaff = mysql_query($query_WADAstaff, $PowerCMSConnection);
$totalRows_WADAstaff = mysql_num_rows($all_WADAstaff);
}
$totalPages_WADAstaff = ceil($totalRows_WADAstaff/$maxRows_WADAstaff)-1;
?>
however, its not returning any content for the PracticeName and I cant figure out why.
Thanks in advance
Jamie