jcbones
Staff Alumni-
Posts
2,653 -
Joined
-
Last visited
-
Days Won
8
Everything posted by jcbones
-
Object Oriented Programming Or Traditional Coding?
jcbones replied to mostafatalebi's topic in PHP Coding Help
It is a matter of opinion, and what you are most comfortable with. If this is a one time thing, or a website that has a small potential for growth, and I didn't have a large class library at my disposal, I would go the traditional (procedural) way, or go with a specific MVC library like cakePHP. -
This is why I 'DEFINE' my all of my configuration variables (constants).
-
Personally, I find Barand's post clear, concise, informative, intelligent, and down right helpful...
-
You have either: 1. spelling error in your column names. 2. spelling error in your variable name.
-
That was an example, and he even posted the example function, although commented out. If that is a direct copy/paste you are doing, it will not work.
-
Post the structure of your database table you are extracting from.
-
We can't either, without any code. For we are not sitting there looking over your shoulder. So, if you want any help, you will have to post the code you are looking at.
-
Put all of your HTML together, and all of your PHP Processing together. You should only have "echo'd" PHP inside the HTML, this will help with de-bugging. We call it: separation of logic and output. Which is why most of us use some sort of template system. Other than that, I have never been a fan of that style of pagination. I think it is wasteful use of resources, and on huge tables, it would be much slower than a 'count' query feeding a limited query. Small tables, I think it would be equally as fast.
-
You could benchmark it, and find the answer pretty quick. IIRC, foreach was slightly faster in the few test that I ran.
-
LOL, that's funny. Implementation means a lot. A link would go a LONG way here.
-
I like the layout, and only noticed a couple of things. 1. Under "My Goals" on the main page, you mis-spelled "came" by leaving off the 'e'. Unless you actually cam across a computer. 2. When you navigate to "Billing", you should probably prompt for a password before you get to the page. Currently a user can see all of the links, but cannot use a link without logging in. I would lock that page down.
-
How To Put Aq Simpel Jquery Pop-Up In A Php File?
jcbones replied to crf1121359's topic in PHP Coding Help
Being that the code provided is a processing script, and not an output script, this code cannot be "put" in there. You will have to find the right functions to pass it to the template, and I'm not a smarty guy. I am assuming that you could put it straight into the template itself, but that would be a straight out guess. -
Php Unable To Increment Any Value But The Last Added To The Array
jcbones replied to Accolade's topic in PHP Coding Help
Are you getting the correct comic id's on your links? -
Amend Php Script To Comply With Hosts New Security Settings
jcbones replied to MacGuyUK's topic in PHP Coding Help
Does the email address in the $SendEmail variable reside on their mail server? Most host will not send the mail if you do not use a valid email address that is on their server. -
Converting Values Inside An Array Into A String
jcbones replied to pioneerx01's topic in PHP Coding Help
I have no Idea what the question is: Are you looking for variable variables, list(), implode(), extract(), ??? -
Well, There is only one EST zone, one PST zone, one CST zone, and one MST zone. So I would say you could pick any single one in the different categories, and you would get the correct time.
-
Have you run the query in a database software like phpMyAdmin, or in the MySQL console? Have you checked the "view source" of the page?
-
You should also change: Line 77: while($file = $d->read()) To: while(false !== ($file = $d->read()))
-
Pretty sure (by your OP query) that you should be joining players table to player_stats, not players_killed, table.
-
Displaying Database Info Based On $_Get Variable
jcbones replied to Stoty's topic in PHP Coding Help
Stoty, I'll explain. Your code must be amended to: $result = mysql_query("SELECT * FROM tblCookbook where id='$frmID'"); while($row = mysql_fetch_array($result)) { print "<pre>" . print_r($row,true) . "</pre>"; //true (boolean) must be added as a second parameter to the print_r() function. Else it will error out, which would be a blank page if display errors is turned off. } ?> Which leads to another de-bugging feature. Add these two lines to the VERY top of your script, right under <?php error_reporting(-1); //report all errors. ini_set('display_errors',1); //display reported errors on the screen. -
I like to use the DateTime object, not sure if it changes these problems though. <?php $date = new DateTime(); $date->sub(new DateInterval('P28D')); echo 'The correct way to do it is: ' . $date->format('Y-m-d');
-
What changed? In the 'entire code' the class declaration is on line 1309 and ends on 1438 (not 1310 to 1441), and it isn't nested.
-
$move = 1; if(move_uploaded_file($tmp,$move++)) {
-
What about a simple id column that is auto incremented, that would be truly unique.
-
I do use it from time to time, but never for $_POST or $_GET. So I'm with Barand on this one.