vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   vB3 Programming Discussions (https://vborg.vbsupport.ru/forumdisplay.php?f=15)
-   -   Need a custom query for Photopost Classifieds (https://vborg.vbsupport.ru/showthread.php?t=204369)

ludachris 02-05-2009 07:28 PM

Need a custom query for Photopost Classifieds
 
For anyone who is familiar with Photopost Classifieds - I'm running version 2.6 and need to renew my membership with them to download the latest version. But right now, I need to create a query that removes all ads older than 90 days. The admin tool allows you to manually delete one at at time, but I have thousands. And many of them have no expiration date.

So basically, I need to run a query that checks the products table and deletes all ads that are 91 days old and older.

Let me know if you need the table names or anything else. Thanks guys.

--------------- Added [DATE]1233869618[/DATE] at [TIME]1233869618[/TIME] ---------------

Am I way off with this query:

Code:

list($sec,$min,$hour,$mday,$mon,$year,$wday,$yday,$isdst) = localtime();
$mon = $mon + 1;
$year = $year + 1900;
$today = mktime($hour,$min,$sec,$mon,$mday,$year);
$hour = $hour + ($Globals['numdays'] * 24);
$deleteads = $today - 90;

$query = "DELETE FROM {$Globals['pp_db_prefix']}products WHERE date = $deleteads AND isauction=0";
$result = ppmysql_query($query,$link);


Marco van Herwaarden 02-06-2009 10:32 AM

If you have questions/problems with a modification or style, then please post in the thread (or support forum/board) about that modification/style. Best chance to receive a reply from either the author or another member using the same modification/style.

ludachris 02-06-2009 03:27 PM

I'm sorry, I thought this was more of a "general programming" forum. I'm just asking about how to write a query. From the other threads I've seen in this forum I'm not sure how this would not be a good forum to ask this question in.

Dismounted 02-07-2009 03:45 AM

PHP Code:

$time strtotime('-90 days'); 

Is that what you want?

ludachris 02-07-2009 02:22 PM

I think that's what I'm looking for. Thanks!


All times are GMT. The time now is 06:07 AM.

Powered by vBulletin® Version 3.8.12 by vBS
Copyright ©2000 - 2025, vBulletin Solutions Inc.

X vBulletin 3.8.12 by vBS Debug Information
  • Page Generation 0.03451 seconds
  • Memory Usage 1,716KB
  • Queries Executed 10 (?)
More Information
Template Usage:
  • (1)ad_footer_end
  • (1)ad_footer_start
  • (1)ad_header_end
  • (1)ad_header_logo
  • (1)ad_navbar_below
  • (1)bbcode_code_printable
  • (1)bbcode_php_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)post_thanks_navbar_search
  • (1)printthread
  • (5)printthreadbit
  • (1)spacer_close
  • (1)spacer_open 

Phrase Groups Available:
  • global
  • postbit
  • showthread
Included Files:
  • ./printthread.php
  • ./global.php
  • ./includes/init.php
  • ./includes/class_core.php
  • ./includes/config.php
  • ./includes/functions.php
  • ./includes/class_hook.php
  • ./includes/modsystem_functions.php
  • ./includes/class_bbcode_alt.php
  • ./includes/class_bbcode.php
  • ./includes/functions_bigthree.php 

Hooks Called:
  • init_startup
  • init_startup_session_setup_start
  • init_startup_session_setup_complete
  • cache_permissions
  • fetch_threadinfo_query
  • fetch_threadinfo
  • fetch_foruminfo
  • style_fetch
  • cache_templates
  • global_start
  • parse_templates
  • global_setup_complete
  • printthread_start
  • bbcode_fetch_tags
  • bbcode_create
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • printthread_post
  • printthread_complete