Jump to content

mschrank99

Members
  • Posts

    16
  • Joined

  • Last visited

    Never

Profile Information

  • Gender
    Not Telling

mschrank99's Achievements

Newbie

Newbie (1/5)

0

Reputation

  1. Hmm, thanks, getting close, but I don't think that'd work. If I had two arrays, and wanted to cut out part of the first one or add the second to it, it'd work. I might just have to go with a for loop... gosh, I'm surprised.
  2. If you think there is no such function and I should just use a for loop to iteratively set the keys back one number after the one I delete, please tell me. I need to work on this today. I just want to save processing power and time if I can.
  3. Yeah. Create a random number up to a maximum, say 100. If < 25 then you have a 25% chance of doing a If > 50 then you have a 50% chance of doing b If > 25 then you have a 75% chance of doing c You see what I'm getting at. Change the numbers and get your brain in a mathematical mood and find the correct numbers for what you want to do. The max random number and the individual numbers will vary depending on how many choices you want and the intended %'s but that is the basic solution.
  4. Hi, Let's say I have an array like this: $array[0] = "ball"; $array[1] = "bat"; $array[2] = "glove"; $array[3] = "referee"; $array[4] = "strike"; $array[5] = "home run"; Now, let's say I want to get rid of [3] but move the next values up, automatically, into 3,4. For example, $array[0] = "ball"; $array[1] = "bat"; $array[2] = "glove"; $array[3] = "strike"; $array[4] = "home run"; Is there a way to simply do this? I could do it using for loops, but is there a simpler way, like a built in function, that will do this for me? Thanks, Matthew
  5. Hmm, yes very interesting. Does anyone know a resource that I could use, I'd love to have something like $addresses = file('http://site.com?find=mysearch&where=60477'); and have it return matching addresses...
  6. What I would love to have is addresses within a certain zip code based on what I search put into an array. For example, I put in "police station" and this hypothetical PHP program goes and searches google, or mapquest/yahoo etc, and returns a neat array of information that I can use to create points on a google map. Does this exist? Is there any way to use PHP to run and return an address search on an external site like google or mapquest?
  7. I would like to create license/registration keys for my online application. I have never done this before so I do not know where to start. I suppose I would like a randomly generated string that could be compared to a static value and then a TRUE or FALSE could be returned. I do not know how to do this though. Of course, it gets tricky because I'd need more than just a 1:1 correspondence (like if I used md5()). I'd need several different strings (thousands even) adding up to the same value somehow. How is this possible? How does Microsoft and all the other non-free software vendors create their CD keys and make sure they are valid? Thanks!
  8. How do I figure out when the current week starts with timestamps? I figured it out with months, for example: $thisMonth = date(d) * 24 * 60 * 60; $thisMonth = time() - $thisMonth; $thisMonth = date(Ymd,$thisMonth); This would give you a timestamp pertaining to the beginning of the month. I want to get one pertaining to the beginning of the week, which seems more complicated. For example, today falls in the second week of feburary. The beginning of the week was the 5th. I need to find some way to figure out on which date the first day of the given week falls. Thanks, Matthew
  9. Does anyone know if there is a way to strip out SQL code from $_POST variables? Perhaps a function similar to strip_tags but instead of catching HTML, it catches SQL statements? Thanks, Matthew
  10. You need to post the error otherwise people will not know what to look for in your script.
  11. Thank you very much- I used the following code: if ($family_accounts != FALSE) {         $count = count($family_accounts); } else {         $count = 0; }
  12. $result... (yadda yadda, postgresql query); $row = pg_fetch_all($result); $count = count($row); The strange thing is, $count is never = 0 when there is nothing to be found. It always returns at least a value of 1. Why is this happening? Thanks, Matt
  13. Yes, but if I set the memory to 50M, wouldn't it crash my server (or at least bring it to its knees) if more than a few people were using it at the same time? But in any case, it's not normal for a 512kb file to hog up over 12 megs of ram right?
  14. You've gotta cut and paste the error message it's given you so we can compare it to the code, otherwise it doesn't help us. -Matthew
  15. did you make sure the module is set to load in apache's config file? (httpd.conf?) Look for "loadmodule mysql"...(something) in httpd.conf If it is "commented out", meaning it looks like: ;loadmodule mysql... Then remove the semicolon, then restart apache.
×
×
  • 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.