Jump to content

XpertWorlock

Members
  • Posts

    123
  • Joined

  • Last visited

Profile Information

  • Gender
    Not Telling

XpertWorlock's Achievements

Regular Member

Regular Member (3/5)

0

Reputation

  1. Yeah I had the idea of doing something similar to this, I just couldn't figure out how to do it properly. For future reference to anyone viewing this thread, it does work
  2. I think I got it working properly using (a modified version of) the query from the following page http://stackoverflow.com/questions/2596489/how-to-select-the-last-two-records-for-each-topic-id-in-mysql
  3. What I would like is it to be sorted by date ASC but get 2 results for each supply. Here I have a better example that people can understand better: Table : Comments post_idcommentdate 123Hi there1312323443 123How are you131232454 123How are you Jim1312342454 146How are you131232454 146How are you131232454 Output : post_idcommentdate 123How are you131232454 123How are you Jim1312342454 146How are you131232454 146How are you131232454 So in this example, I would want to take 2 of the latest comments by each post
  4. What I'm trying to do is group by supplies but return 2 of each and than sort by date TABLE NAME : FRUIT supplies | type | date 4 | apple | 1357656565 4 | orange | 123333321 4 | pear | 1212312321 6 | grape | 1312312321 6 | grapefuit | 13121312321 Results in : 4 | apple | 1357656565 4 | orange | 123333321 6 | grape | 1312312321 6 | grapefuit | 13121312321 For the life of me I can't get my brain to wrap around it. I'm pretty sure I've done this before and it had to be done by using a subquery. Can anyone help?
  5. Easy PHP class to send HTML e-mail. I was in the same boat and wanted a consistent design across all e-mails (forgotten passwords, etc). I'd suggest a trial run to yourself always to make sure it's working properly http://blog.hostgrenade.com/2011/07/31/php-email-class/
  6. Okay, I have caches of pages and I need to be able to get a sql query to search more than one keyword, the table goes as following : KEYWORD URL ----------------------- martial home arts home martial about Example : if I search "martial arts", how would I get back results in order "home","about". As "home" has both words, where "about" has only 1 word? Any help guys?
  7. Hey guys, I have a SQL query that goes like this SELECT page FROM keywords WHERE keyword_id = '17' UNION SELECT page FROM keywords WHERE keyword_id = '36' ORDER BY weight DESC SQL TABLE goes as this keyword_id page weight 17 example.php 20 36 example.php 80 17 test.php 5 36 test.php 10 So for this example, I need the results to return the "example.php" row first. I need it to add the 2 weights together (100,15) by page So the outcome would be : example.php test.php Any help guys
  8. First time I've ran into this problem. What I am doing is getting the content of a page, cutting it in half (for big pages), and than putting them back together (not in this). $half = intval((strlen($html) / 2)); $html1 = substr($html,0,$half); $html2 = substr($html,$half); Now most of the time this works perfectly fine, as all I'm doing is what I explained above. Unfortunately on one page I got a silent error (the script just stopped even though report all is on), but it seems to be "Cannot convert to ordinal value" on the line where $html1 is set. I could fix it with htmlspecialchars() but it makes the strings bloated. Any help guys?
  9. Yeah I was on my last hopes when I started the thread, thanks for clearing that up for me.
  10. Thanks for the reply, Correct me if I'm wrong, but I think filetype is for files on my server, unfortunately I'm looking to tell if a url on another server is a folder or not.
  11. This one stumped me, but maybe someone has figured it out. I'm trying to write a script that is able to decide whether a remote url is a directory or a file, this is fine until it comes to mod_rewrite(rewritten?) urls. ex. http://www.example.com/test Now this could be test.php,test.html etc., but in the rare case, it could also be a folder (example.com/test/index.php). Anyone have any ideas?
  12. trying to get a reg exp to get the current directory of a string (not working directory). So far what I have is : http\:\/\/www\.([a-zA-Z0-9\-\.]+)([a-zA-Z0-9\-\/]*) the problem is it will capture the filename too : ex . http://www.example.com/testFolder/test.php output -> http://www.example.com/testFolder/test I'm assuming I have to use a look ahead to ensure there is no extension, but I've never fully grasped look aheads. Can anyone help?
  13. got it, in case people would like to know ^(?!www)([a-z]*)\.
  14. trying to get a reg exp to work with any characters except certain words ex : www.adssa <-ignore as.ads <-capture Current code : ^([a-z]*(www))\. this captures www, I just can't figure out how to capture the opposite
×
×
  • 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.