close ad
Databridge V2 with MySQLi support IS Now Available!
open ad
View Menu

Technical Support Forums

Free, outstanding support from WebAssist and your colleagues


recordset wrangling

Thread began 4/14/2015 12:43 pm by Jamie | Last modified 4/15/2015 12:53 pm by Ray Borduin | 403 views | 2 replies |


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

$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";
$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


Sign in to reply to this post

Ray BorduinWebAssist

This part of the qeury looks wrong:

practices.PracticeName = practice_staff.StaffPracticeID AND practices.PracticeName = practice_staff.StaffPracticeID

seems like it should be just:

practices.PracticeID = practice_staff.StaffPracticeID

Sign in to reply to this post
Did this help? Tips are appreciated...


perfect thanks Ray

Sign in to reply to this post

Build websites with a little help from your friends

Your friends over here at WebAssist! These Dreamweaver extensions will assist you in building unlimited, custom websites.

Build websites from already-built web applications

These out-of-the-box solutions provide you proven, tested applications that can be up and running now.  Build a store, a gallery, or a web-based email solution.

Want your website pre-built and hosted?

Close Windowclose

Rate your experience or provide feedback on this page

Account or customer service questions?
Please user our contact form.

Need technical support?
Please visit support to ask a question





Ease of use


security code refresh image

We do not respond to comments submitted from this page directly, but we do read and analyze any feedback and will use it to help make your experience better in the future.

Close Windowclose

We were unable to retrieve the attached file

Close Windowclose

Attach and remove files

add attachmentAdd attachment
Close Windowclose

Enter the URL you would like to link to in your post

Close Windowclose

This is how you use right click RTF editing

Enable right click RTF editing option allows you to add html markup into your tutorial such as images, bulleted lists, files and more...

-- click to close --

Uploading file...