Jump to content

Recommended Posts

Hi, just having a little trouble with nested MySQL conditions

 

the following will query all entries within a set category defined by the ID

 

$query = "SELECT * FROM #__content WHERE (catid = '$cat1')";

 

which is great, however since this is a joomla database I wanted to make the application I'm designing won't pull content which has been unpublished so I tried expanding my condition to the following.

 

 

$query = "SELECT * FROM #__content WHERE (catid = '$cat1' & publish_down < publish_up)";

Unfortunately, this seems to pull in all published content from every category.  What would be the appropriate way of doing this?

Link to comment
https://forums.phpfreaks.com/topic/151932-solved-conditions-within-mysql-query/
Share on other sites

hmmm...that was simple enough.  It looks like it worked, but I think I mistook what the publish_down column was intended for(scheduling when to unpublish).  Does anyone know how Joomla 1.5 differentiates between published/unpublished articles? 

hmmm...that was simple enough.  It looks like it worked, but I think I mistook what the publish_down column was intended for(scheduling when to unpublish).  Does anyone know how Joomla 1.5 differentiates between published/unpublished articles? 

 

Not sure, but you can find an unpublished and a published article and look in the database between what the differences are.

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.