Results 11 to 20 of 21
-
6th Jan 2011, 01:42 AM #11Respected DeveloperWebsite's:
wrzc.orgPHP Code:$query = $vbulletin->db->query_read("
SELECT p_id
FROM purchases, client
WHERE id = cid
AND id IN
(
SELECT cid
FROM purchases
WHERE date < 123455667
)
");
The above will give you all the purchases. Just change SELECT p_id to SELECT name or whatever you want to select.
I really hope I understand now what your after and this is what you want as it's getting late here.Tutorial How to SEO your Warez Site a guide to help you increase your organic traffic
Huge list of Warez Sites and free Multiposter Templates
-
6th Jan 2011, 03:04 AM #12Respected Member
That won't work either ..
try this:
PHP Code:SELECT p_id
FROM purchases, client
WHERE id = cid
AND id not IN
(
SELECT cid
FROM purchases
WHERE from_unixtime(date) > '20100101'
)
-
7th Jan 2011, 12:15 AM #13MemberWebsite's:
epicimagehost.com@Lockdown, I dont see why Mr Happy is wrong if it's stored as a unix timestamp, there should be no issue with his query. If I'm wrong, I blame the fact that it's over 1AM
-
7th Jan 2011, 04:16 AM #14Respected Member
In his subquery he is checking purchases older than a year and saving clients.
SO he will also get clients that have made purchases less than 1 year. Which is specifically what tdsii was avoiding and couldn't figure out.
In mine I check for purchases made after the year or date and save the clients. Then I check for purchases made by clients who are not in that list. So I avoid agetting the clients who made old prurchases and new purchases.
Hope that wakes you up.
-
7th Jan 2011, 02:40 PM #15OPBannedWebsite's:
SKDown.Net WarezGuru.Org RARdownload.netLock Down: i guess you understood me.
all queries are wrong. please read again my post to save everyone's time
-
7th Jan 2011, 04:34 PM #16Respected Member
Show me the real names of your tables and the real field names for customer id and purchase date and I can give you a real mysql query.
You can pm me the info if you wish. But based on the garbage names of tables and fields floating around of course it does not work...
The query I gave you is sound but I need real names to give you a real query.
-
7th Jan 2011, 07:30 PM #17
-
9th Jan 2011, 10:25 PM #18OPBannedWebsite's:
SKDown.Net WarezGuru.Org RARdownload.netwe should select the MAX dat for each site and see if its maximum date entry is older than a year from now.
if so we select all its rows. if not, we don't select any of its rows.
-
10th Jan 2011, 12:13 AM #19Respected Member
That is exactly what this query does. I will use the exat names in your first post:
Give me the name of the table and the fields as I asked because that is exactly what this query does.
purchases
---------
p_id
c_id
date
SELECT * FROM purchases WHERE c_id not IN
( SELECT c_id FROM purchases WHERE from_unixtime(date) > '20100101' )
// this part says select clients who have made purchases less this year
-
10th Jan 2011, 12:22 PM #20OPBannedWebsite's:
SKDown.Net WarezGuru.Org RARdownload.netyeps its my bad when i was changing some attributes.
you got your 5 bucks this one is solved
hurray!
Sponsored Links
Thread Information
Users Browsing this Thread
There are currently 1 users browsing this thread. (0 members and 1 guests)
Similar Threads
-
PHP - MySQL query to CSV export
By ElitePirate in forum Web Development AreaReplies: 2Last Post: 25th Jul 2012, 09:19 PM -
mysql query to export database
By lenney in forum IP.BoardReplies: 4Last Post: 7th May 2011, 03:43 PM -
MySql Query
By GoPantheoN in forum Web Development AreaReplies: 5Last Post: 8th Mar 2011, 02:09 PM -
WordPress database error MySQL server has gone away for query
By blur88 in forum Webmaster DiscussionReplies: 10Last Post: 27th May 2010, 08:43 PM -
Speed Up Your Web Site With MySQL Query Caching
By BlaZe in forum Technical and Security TutorialsReplies: 1Last Post: 4th Nov 2009, 03:11 PM
themaCreator - create posts from...
Version 3.24 released. Open older version (or...