Jump to content

pureDesi

Members
  • Posts

    19
  • Joined

  • Last visited

    Never

Profile Information

  • Gender
    Not Telling

pureDesi's Achievements

Newbie

Newbie (1/5)

0

Reputation

  1. I have an array, let's say it's values are ['A', 'B', 'C', 'D']. I want to list out all the possible combinations that can be achieved using these values so it would display something similar to A B C D AB BA BC BD CA CB CD DA DB DC ABC ABA ABD .... So on and so forth. I've been working on it for some time and can't even come up with an algorithm, can anyone please assist me? Thanks
  2. Crap - ran into a problem, how would you do case insensitive using preg_replace ? EDIT: I take that back! Just looked it up on php.net, modifiers FTW! Thanks again.
  3. I appreciate the help, I got it working using generic's code. Cheers.
  4. I'm trying to replace all occurrences of {image:*} with <img src='*' /> using eregi_replace and I'm getting some awkward results. The following code is what I used, the output is shown below. code in question: $string = "This is a test {image:5.bmp} why won't you work! {image:test.jpg} grr"; $pattern = "{image:(.+)}"; echo eregi_replace($pattern, "<img src='files/\\1' />", $string); output: This is a test <img src='files/5.bmp} why won't you work! {image:test.jpg' /> grr However, when there's only one occurrence of {img src='*'} in the string, it works like a charm. Do you guys have any clue as to why this is happening? Thanks
  5. Ah! I appreciate the help, and it now works!
  6. I'm new to MySQL and couldn't figure this out for the life of me, I'm trying to pull out stats for a game from another table with a restriction, see below. SELECT gameID, gameTitle, gameUnique, COUNT(mapID) FROM games, maps WHERE gameEnabled=1 AND mapParentID = gameID ORDER BY gamePriority DESC, gameTitle ASC It's intention is to pull all the games out (if it's enabled) and count how many maps are in each game from a separate table, "maps". I'm completely lost as to how I would use GROUP BY. Any help would be appreciated Thanks for your time -pure
  7. I was scared of that.. Well I have a flash app that uses DHTML history and was going to implement some stuff using it.. but I guess I'll have to resort javascript.
  8. Nope, does the exact same thing :(
  9. I've looked around and couldn't find a solution, and I'm not entirely sure if it's possible. But is it possible to get the full URL including what's after the hash symbol (#) ? $_SERVER['QUERY_STRING'] returns everything after the question mark but stops as soon as it hits the # symbol. Thanks.
  10. Ahh.. thank you, I've been looking at this page for about an hour refreshing it every 2 minutes until I saw your reply, Thanks :D
  11. I have this query being passed to MySQL: [code] UPDATE forums, threads SET forums.lastThreadID=MAX(threads.threadID)-1, forums.lastMemberID='5', forums.numPosts = forums.numPosts+1, threads.replies = threads.replies+1 WHERE forums.forumID = threads.forumID AND threads.threadID = '3'"; [/code] And I keep getting [code]#1111 - Invalid use of group function [/code] I have no clue why and I've tried a couple of different things, but to no avail. Any help would be appreciated.
  12. Thanks for the speedy replies :D And I'd rather not go in-depth on my coding styles :S
  13. I've got a small question, how do I find (not SET) the auto_increment value of a table (in mySQL). Thanks
  14. Works like a charm, and not only that I now understand it. Thank you jawapro.
  15. [code]SELECT boards.boardID, boards.title, categories.title FROM boards, categories[/code] Whenever I run this query I get double results for everything, I'm almost certain this is an easy problem, however I'm just starting to learn MySQL. Thanks for the help.
×
×
  • 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.