Jump to content

PeerFly

Members
  • Posts

    33
  • Joined

  • Last visited

    Never

Profile Information

  • Gender
    Not Telling

PeerFly's Achievements

Newbie

Newbie (1/5)

0

Reputation

  1. I have an issue that I can’t figure out. I have a huge query that searches on columns: a,b,c,d,e,f pulling from a DB of nearly 5 million records. I can make a multi column index on a,b,c,d,e,f but the query is dynamic because it may search on a,b,e,f or b,d,f. The amount of indexes I would need to create for this would probably be 36 (because of the leftmost prefix rule). I know that is rather absurd. So, how can I make sure everything is indexed so searches are fast on this large query and I don’t have to make all the indexes? I don't want to have to do this: a,b,c,d,e,f b,c,d,e,f c,d,e,f d,e,f e,f f a,f a,e,f a,d,e,f And so on and so forth..... This would not only take a long time to do on 5 million rows, it would take an insane hit when a row is inserted/deleted because of all the indexes.
  2. Corbin, in the PHP script I have a few pixels that load when the page loads. Those pixels actually aren't images, but calls to specific URL's. I can't simply load those URL's into the cron because they are dynamic, and their variables are powered by the script. I just need a way to open the page so that the images load (the url's of the images are called). Perhaps I should have used "loading" instead of "launching."
  3. Hello freaks, I've been having this issue for quite some time. I absolutely cannot solve it with the power of Google alone. I have a small PHP script that launches some 1x1 pixels (images). I've used lynx, wget and curl with cron but even though the script is accessed, the pixels aren't launched. My guess is that it's because those commands don't have image support? I don't know. My latest attempt was this: curl -s -o /dev/null "script here" Like I said, I've tried wget and lynx and nothing is launching these pixels. However, if I open the script manually in my browser, the pixels launch so I know it has nothing to do with the actual html. Any suggestions?
  4. J, what the code does so far is it adds up all the users earnings from the database and then puts their totals into a new separate column called "amnt". For instance, if Joe has 5 rows in the earnings table where each dollar value from the "amount" column sums up to $10.00, then by doing this code, it will distinctively display Joe one time, and then the new "amnt" column will show Joe's total sum of money. What I am trying to do is display ONLY the rows where "amnt" is greater than zero. The strange thing is that you can order by the temp amnt column, but you cannot create a "where" clause with it for some reason. There has to be a way.
  5. Ok, but that doesn't fix my problem. I'm trying to only show rows where the amnt column is greater than zero but it's not working because the amnt column really isn't a physical column, just one that I made up on the fly from a sum. How can I make it work?
  6. The code below works fine. select distinct(u.userid), u.*, sum(e.amount) as amnt from `users` as u left join `earnings` as e on u.userid = e.referral where u.referrer = '$userid' group by u.userid ORDER BY amnt DESC LIMIT $from, $max_results Now, if I want to ONLY display rows where amnt is GREATER THAN zero, it doesn't work. How can I make it a statement on a column that was just created from a sum? This doesn't work: select distinct(u.userid), u.*, sum(e.amount) as amnt from `users` as u left join `earnings` as e on u.userid = e.referral where u.referrer = '$userid' and amnt > 0 group by u.userid ORDER BY amnt DESC LIMIT $from, $max_results This seems like a really simple problem but I can't figure it out.
×
×
  • 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.