close ad
 
Important WebAssist Announcement
open ad
View Menu

Technical Support Forums

Free, outstanding support from WebAssist and your colleagues

rating

Recordset total record count problem using LEFT OUTER JOIN

Thread began 9/13/2019 9:15 am by mlowe4 | Last modified 9/23/2019 7:52 pm by Ray Borduin | 559 views | 6 replies |

mlowe4

Recordset total record count problem using LEFT OUTER JOIN

Hi i'm having an issue with the display total records count, it displays 18 records from one table and 3 from the other doing a LEFT OUTER JOIN, this should come to 21 but displays 18, I've included screenshots showing the count and SQL recordset, I've tried grouping by logs.id and eventlog.id but returns 1 in the count, any help will be much appreciated, I don't know if i'm just missing something in the SQL statement or whether it's a problem with the MySQLi behaviours extension.

The parameters i'm using $qget is just isset $_GET['q'] just in a customised variable form

Many thanks
Michael

Sign in to reply to this post

Ray BorduinWebAssist

A left join won't necessarily show the combined rows in the result. I'm thinking your SQL statement is wrong, but I'm not sure exactly what you are trying to achieve, so I can't comment on how to improve it.

Maybe try displaying the final SQL statement with:
<?php
echo($combinedlogs->debugSQL());
?>

Than you can cut and paste that into phpMyAdmin and see the full results and try to figure out what query returns the actual results you expect or need. I could help with this in a premier support ticket, but I'd need to have a conversation with you to figure out what you are trying to do and see it in context to figure out what the right SQL statement is.

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

mlowe4

Thanks for the reply, the debug code helped, it returned 18 so the WebAssist code is correct, I guess I just can't count the extra records using a left join, you were correct the main SQL code was wrong, I've corrected that now, thanks, the problem still exists with what I'm trying to do but I can settle by ordering by logs.id I have two log tables that I was trying to join together but could only join on id for both anything else I tried returned multiple records over and over again, so I joined on id and wanted to order by logs.date on the left table with the records being affected on the right, but having tried everything I don't think it's possible but id will do, many thanks for your help it was much appreciated

Sign in to reply to this post

mlowe4

I figured out the problem. I need a full outer join which the extension doesn’t support, would it be possible to support this join in the next revision of the extension please.

Many thanks

Sign in to reply to this post

Ray BorduinWebAssist

You should be able to type in whatever join you need. What do you mean by not supported?

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

mlowe4

Hi thanks for replying I can only select between none, left outer join, right outer join or inner join in the query builder, I tried modifying the code to read full outer join but it returns the error in SQL syntax, I think I might be able to do it through just the execute SQL command but it’s definitely not in the query builder, so I can’t seem to bind parameters in the way I would like

Sign in to reply to this post

Ray BorduinWebAssist

Couldn't you switch the order of the tables added and use a LEFT OUTER JOIN?

FROM eventlog LEFT OUTER JOIN logs

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

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

Content

rating

Layout

rating

Ease of use

rating

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...