Jump to content

gary00ie

Members
  • Posts

    22
  • Joined

  • Last visited

    Never

Profile Information

  • Gender
    Not Telling

gary00ie's Achievements

Newbie

Newbie (1/5)

0

Reputation

  1. Thank you for your response. I did google it, which is something I always do before posting on a forum. I was just trying to find a solution better than the one's that I found that were not very good. That s why I posted here on a PHP forum.
  2. Does anybody else have any idea's on this? I would love to get some sort of solution today and any help would be much appreciated. Thanks in advance.
  3. Great, I eagerly await a complete PHP OOP solution to this. I'm really interested to hear further responses as it's really interesting to me and I just think a good example would be beneficial for future development from many developers. I guess, to further clarify, I just would like to have a MySQL wrapper class that is fully OOP (with or without an abstract class or interface) and with solid functions which is secure and I can't seem to find what I need. This is both for a learning experience and also to have a base for something I can modify, expand upon and share. I hope to get some more responses and thanks for all the replies thus far.
  4. Oh no, I don't want to over complicate it at all, in fact, just the opposite. I want the simplest, efficient, yet elegant class. However, what I also want is to have strictly OOP PHP5 code, no var's to define variables, just private, public etc. and a solid class with try catch's to handle errors. I want to learn from it and hopefully modify it to use as my default db wrapper for future projects. Sorry if I made that unclear in my original post.
  5. Hi there, Thanks so much for the reply, I appreciate it. This is not really wht I am looking for though. That is kind of what I already have. I want total OOP as in no var to define variables. I am looking more for private, protected etc. for my variable declarations. Again, thanks so much for your time.
  6. Hi, I am trying to find the best (best as in fastest and OOP) MySQL connection wrapper to connect, query, insert, delete and query a MySQL DB. I want to do this so I don't have to keep flipping from one or two that I have which are sluggish and also doesn't do everything I need. I am coming from a JAVA background with a little experience and I learn well from seeing code. I would just love to see some code that will do the above in a clean and efficient manner. I also want to do this very OOP style. My questions are: - do I need abstract classes or interfaces or is that overkill? Also, is it a good idea to keep the db user / pass etc. in the database wrapper class? Or, would they be better off in a config file which is included? I have been away from programming for almost two years and would very much appreciate some guidance and I am not so much asking for a handout in regards to code, but, to get me started again, could someone please give me a little guidance here, as in what I need to do with perhaps a bit of code? I want to make this class fully OOP with try / catch blocks etc. Thanks in advance. I really appreciate any help you guys can give.
  7. Thanks for all the help guys. I think I have this figured out now. Thanks again!
  8. Thank you for that. It is pretty much very close to what I had. I need to do it with no helper PHP functions though.
  9. Why? It is what I was asked for. I'm just having a little trouble figuring it out.
  10. Seems pretty straight forward, where exactly are you stuck? Sorry, but that statement makes little sense. I was using the built in arryay_keys and array_search to do this. But, I need to do it without using those methods.
  11. Hi, I need to do this: Write a method to quickly find the array index position of a given number in a ascending sorted array of numbers. e.g. in an array { 1, 2, 5, 10, 102 }, the array index position of a given number 5, would have an answer of 2. We're looking for an answer that's better than O(n). I was using php's built in methods but I need to do this with a basic function using no helper methods. Can anybody help me out with this? Thanks in advance.
  12. Thanks for the reply. The only problem is, I want to be able to add 1 + 1 = 2 and also 2.2 + 2.2 = 4.4. I am using doubles now and getting 1 + 1 = 2.0. Is there a way to distinguish if it is an int, then don't print the 2.0, just the 2? Thanks again.
  13. Hi! I am trying to make a simple calculator in Java. I was wondering, if the user enters 1 + 2 - those are both integers. But if they enter 1.2 + 2.2 those are doubles or floats. How do I test for both? Is there some way to declare the input as a double and if it is an int, then remove the.000 etc.? Thanks in advance
  14. Thank you both for the replies. So could I have - as the delimiter also? $dateStr = '2010/11/11'; // or 2010-11-11 echo preg_match('/\d{4}/', $dateStr, $matches); Also, $dateStr could also be: DD-MM-YYYY also, correct?
  15. Hi, I need a fast function to extract the year (YYYY) from a string. The string will be YYYY-MM-DD or DD-MM-YYYY. Would a regular expression help with this? Maybe something like: echo preg_match($dateStr); Any help would be appreciated. I'm getting nowhere with this. Thanks in advance
×
×
  • 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.