close ad
 
Important WebAssist Announcement
open ad
View Menu

Technical Support Forums

Free, outstanding support from WebAssist and your colleagues

rating

show delete if not in both tables

Thread began 1/09/2013 11:22 am by randyw2394710 | Last modified 1/09/2013 1:54 pm by randyw2394710 | 2378 views | 7 replies |

randyw2394710

show delete if not in both tables

i have two joined tables gallery and gallery history i was able to show inserted and updated now if i delete from gallery and not history i want to show deleted
<?php
if ("".$row_gallery['created'] ."" == "".$row_gallery['historycreated'] ."") { // WebAssist Show If
?>
Inserted
<?php
} // ("".$row_gallery['created'] ."" > "".$row_gallery['updated'] ."")
?>
<?php
if ("".$row_gallery['created'] ."" > "".$row_gallery['historycreated'] ."") { // WebAssist Show If
?>
Updated
<?php
} // ("".$row_gallery['created'] ."" > "".$row_gallery['created'] ."")
?>
<?php

if ("".$row_gallery['pg1_gallery.id'] ."" != "".$row_gallery['pg1_galleryhistory.id'] ."") { // WebAssist Show If
?>
Deleted
<?php
} // ("".$row_gallery['id'] ."" != "".$row_gallery['id'] ."")
?>
------------------------------------
and the record set
SELECT count(pg1_gallery_images.imgsrc) AS `number of images`
, pg1_gallery_images.*
, pg1_gallery_images.photoComment
, pg1_gallery.id
, pg1_gallery.created
, pg1_gallery.GalleryName
, pg1_gallery_images.gallery_id
, pg1_galleryhistory.*
, pg1_galleryhistory.id
, pg1_galleryhistory.historycreated
, pg1_galleryhistory.historyGalleryName
, pg1_gallery_images.watermark_text
FROM
pg1_gallery
LEFT OUTER JOIN pg1_gallery_images
ON pg1_gallery.id = pg1_gallery_images.gallery_id
RIGHT OUTER JOIN pg1_galleryhistory
ON pg1_gallery.id = pg1_galleryhistory.id
GROUP BY
pg1_gallery_images.gallery_id
, pg1_gallery.id
, pg1_gallery.id
, pg1_galleryhistory.historycreated
, pg1_galleryhistory.historyGalleryName
, pg1_gallery_images.watermark_text
ORDER BY
pg1_gallery.id DESC

Sign in to reply to this post

Jason ByrnesWebAssist

you may have to change the join types being used in order to accomplish this.

when the gallery is deleted the $row_gallery['pg1_gallery.id'] will return NULL

so use:
if($row_gallery['pg1_gallery.id'] == NULL) {

Sign in to reply to this post

randyw2394710

ok i did this
<?php
if ("".$row_gallery['GalleryName'] ."" == "") { // WebAssist Show If
?>
Deleted
<?php
} // ("".$row_gallery['GalleryName'] ."" == "")
?>
deleted shows up but inserted is still there

Sign in to reply to this post

randyw2394710

i think i got it to work

Sign in to reply to this post

randyw2394710

how do you show only if two rows are equal

Sign in to reply to this post

Jason ByrnesWebAssist

if ("".$row_gallery['created'] ."" == "".$row_gallery['historycreated'] ."") {


should already do that

Sign in to reply to this post

randyw2394710

yes i thinks its good have to make sure all criteria is the same or different i was close just needed the push thanks

Sign in to reply to this post

Jason ByrnesWebAssist

you would need another condition around the inserted if statement:
<?php
if ("".$row_gallery['GalleryName'] ."" != "") { // WebAssist Show If
?>
<?php
if ("".$row_gallery['created'] ."" == "".$row_gallery['historycreated'] ."") { // WebAssist Show If
?>
Inserted
<?php
} // ("".$row_gallery['created'] ."" > "".$row_gallery['updated'] ."")
?>
<?php
} // ("".$row_gallery['GalleryName'] ."" != "")
?>

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

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