Activity Stream
48,167 MEMBERS
61128 ONLINE
besthostingforums On YouTube Subscribe to our Newsletter besthostingforums On Twitter besthostingforums On Facebook besthostingforums On facebook groups

Page 2 of 3 FirstFirst 123 LastLast
Results 11 to 20 of 21
  1.     
    #11
    Respected Developer
    Website's:
    wrzc.org
    PHP 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
                )
        "
    ); 
    lol just as well you explained it again as I had no clue that that's what you wanted.

    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

  2.   Sponsored Links

  3.     
    #12
    Respected 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'
                

    The client after purchases should not be needed either. Just purchases not purchases, client .

  4.     
    #13
    Member
    Website'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

  5.     
    #14
    Respected 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.

  6.     
    #15
    Banned
    Website's:
    SKDown.Net WarezGuru.Org RARdownload.net
    Lock Down: i guess you understood me.

    all queries are wrong. please read again my post to save everyone's time

  7.     
    #16
    Respected 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.

  8.     
    #17
    Member
    Website's:
    epicimagehost.com
    Quote Originally Posted by Lock Down View Post
    In his subquery he is checking purchases older than a year and saving clients.
    ...
    Hope that wakes you up.
    It did

  9.     
    #18
    Banned
    Website's:
    SKDown.Net WarezGuru.Org RARdownload.net
    we 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.

  10.     
    #19
    Respected 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 do not include clients who are in the list below because they made purchases in one year

    // this part says select clients who have made purchases less this year

  11.     
    #20
    Banned
    Website's:
    SKDown.Net WarezGuru.Org RARdownload.net
    yeps its my bad when i was changing some attributes.

    you got your 5 bucks this one is solved

    hurray!

Page 2 of 3 FirstFirst 123 LastLast

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. PHP - MySQL query to CSV export
    By ElitePirate in forum Web Development Area
    Replies: 2
    Last Post: 25th Jul 2012, 09:19 PM
  2. mysql query to export database
    By lenney in forum IP.Board
    Replies: 4
    Last Post: 7th May 2011, 03:43 PM
  3. MySql Query
    By GoPantheoN in forum Web Development Area
    Replies: 5
    Last Post: 8th Mar 2011, 02:09 PM
  4. WordPress database error MySQL server has gone away for query
    By blur88 in forum Webmaster Discussion
    Replies: 10
    Last Post: 27th May 2010, 08:43 PM
  5. Speed Up Your Web Site With MySQL Query Caching
    By BlaZe in forum Technical and Security Tutorials
    Replies: 1
    Last Post: 4th Nov 2009, 03:11 PM

Tags for this Thread

BE SOCIAL