
gary00ie
Members-
Posts
22 -
Joined
-
Last visited
Never
Everything posted by gary00ie
-
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.
-
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.
-
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.
-
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.
-
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.
-
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.
-
Thanks for all the help guys. I think I have this figured out now. Thanks again!
-
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.
-
Why? It is what I was asked for. I'm just having a little trouble figuring it out.
-
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.
-
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.
-
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.
-
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
-
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?
-
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
-
Hi, I know this is a very simple problem,but,I can't see the issue: INSERT INTO job_postings ( `position`, `employer`, `city`, `state`, `email`, `description`, `contact`, `website`, `expiry`, `created_at`, `modified_at` ) VALUES(`Gary Test1`, `Gary Test2`, `Gary Test3`,`FL`, `[email protected]`, `Gary Test desc`, `Gary Test4`, `http://www.site.com`, now(), now(), now() ) What am I doing wrong? With this string I'm getting the error: #1054 - Unknown column 'Gary Test1' in 'field list' I've been doing sql for a long time and just thinkI've been looking at this too long... Also, apologies for the simpleton question, you guys are always just a great help. Thanks in advance for any help. -Gary
-
THanks a million for the suggestions and the link. I looked through the tutorial and it fixed all the issues I was having. Thanks again
-
Hi, I have a 3 column layout. It works fine in IE8 but on every other browser it fails, it spills into the center div (screenshot attached). Anybody have any idea why this might be happening? CSS code: /* All the content boxes belong to the content class. */ .content { position:relative; /* Position is declared "relative" to gain control of stacking order (z-index). */ width:auto; /*width:580px;*/ width:680px; /*min-width:120px;*/ min-width:640px; margin:0px 210px 20px 170px; /*margin: 0 210px 210px 170px;*/ /*border:1px solid black;*/ border:1px dashed black; background-color:white; padding:10px; z-index:auto; /* left:60px;*/ left:80px; ; /* This allows the content to overlap the right menu in narrow windows in good browsers. */ } #navAlpha { position:absolute; /*width:150px;*/ /**width:190px;**/ width:205px; top:20px; left:20px; border:1px dashed black; background-color:#eee; padding:12px; z-index:1; /* IE hack */ voice-family: "\"}\""; voice-family:inherit; /*width:128px;*/ /**width:198px;**/ width:215px; } body>#navAlpha {width:215px; } #navBeta { position:absolute; /*width:190px;*/ /**width:200px;**/ width:225px; top:20px; right:20px; border:1px dashed black; background-color:#eee; padding:10px; z-index:1; /* Again, the ugly brilliant hack. */ voice-family: "\"}\""; voice-family:inherit; width:168px; } /* Opera 5 hack */ body>#navBeta {width:225px;} Thank you [attachment deleted by admin]
-
Thanks for that. That was my initial thought but I'd prefer not to but seen as it's just one include file it might be the easiest solution. Although, in saying that, I just noticed that some of the included CSS includes are not showing up either on occasion. I have a feeling something else is going on here. Thanks again for all the replies and suggestions.
-
Thanks for the reply Ken. Maybe I didn't explain my situation correctly. I don't see how that can help me in this particular situation. I have a url: www.mysite.com I am testing a new site in a directory as follows: www.mysite.com/test/ This test directory holds a new site which has links to eachpage within that test site, i.e. www.mysite.com/test/index.php But when I click on link1.php on the test site, I get: www.mysite.com/test/index.php/link1.php Do you have any ideas what's going on? Sometimes it works fine and goes to the correct link buut not for the most part. Any help / ideas would be appreciated.
-
Hi, This may seem like a dumb question, but, I'm developing a site, I have all my pages almost finished, however, I have a problem that is so simple that I think I just need a fresh point of iew on it! I have a site :www.fobar.com/test/index.php - I have a sidebar menu with links i.e. <a href = page1.php>Page1</a> <a href = page2.php>Page2</a> etc. Whenever I go from page1 to page2, the page isn't found because the url is showing up as: www.fobar.com/page1.php/page2.php rather than: www.fobar.com/page2.php Am I doing something incredibly stupid? I never came across this before that I can remember. Any idea's would be much appreciated. Thanks in advance!