Larry
Administrators-
Posts
5413 -
Joined
-
Last visited
-
Days Won
155
Everything posted by Larry
-
Redirect From Https Back To Http
Larry replied to Virtual_Skippy's topic in Effortless E-Commerce with PHP and MySQL
That code doesn't turn all your links into HTTPS links. That code ensures that register.php and the admin directory are accessed via HTTPS. What turns all the links on register.php into HTTPS links is the use of relative links. Since register.php is HTTPS, any relative link on that page is HTTPS. To get people to pages via HTTP, create absolute links to HTTP. -
Foreign Key Coffee Question
Larry replied to nomadsoul's topic in Effortless E-Commerce with PHP and MySQL
"KEY" is just another term for INDEX, so the CREATE statement creates an index on that column, as it's a foreign key to the other table. The purpose is to improve the performance of those JOINS. You can, by the way, define foreign key constraints in the table structure, depending upon the version of MySQL in use, and if using the InnoDB storage engine. -
Yeah, many of the things that I talk about in the book as being planned for PHP 6 ended up in PHP 5.3, in places like the SPL (Standard PHP Library). I'm trying to figure out how to introduce the SPL in the fourth edition of this book. The third edition of my PHP Advanced book will probably cover it in detail.
-
Outputting Stdout From Exec Call
Larry replied to Stuart's topic in PHP 5 Advanced: Visual QuickPro Guide (2nd Edition)
Check out the PHP manual's page for the exec() function to see how to assign the output of the command to a variable. Or you could use the system() function. -
Ability For Custom Checkout Fields
Larry replied to David L's topic in Effortless E-Commerce with PHP and MySQL
I generally agree with Stuart here, although an alternative would be to create a custom_fields table, with the various properties, and a custom_fileds_data table. That table would store the custom_field_id, the user's data, and a link to the other table that stores the non-custom user data. -
Hey Stuart, I'm glad that Zend_Lucene article was useful for you. Good luck with your project. I would be inclined to keep the files organized as they are, at least because it's convenient and easiest. There can be performance issues putting too many files and directories in one folder, but it depends upon the OS in use.
-
You're welcome. As for this question, what version of PHP are you using? It's pretty important information, which is why the guidelines specifically recommend that you include it. In fact, if you want fast answers, I would recommend reviewing the guidelines, because there are lots of good suggestions there.
-
Q About Multiple Inner Joins
Larry replied to HartleySan's topic in Effortless E-Commerce with PHP and MySQL
Thanks, guys, for this thread. It's a good one. The order in which you list the tables should not impact the results so long as you're using INNER joins and I generally agree with what Matt said about how he views this. One thing to consider, though, is performance: the faster you can narrow down the result, the better. I would recommend taking this experiment a step further and running different versions of the same join through EXPLAIN queries to see if MySQL thinks it would handle one ordering of tables better than another. You could benchmark the join in different orders, too, but benchmarks have a way of not being accurate. -
That seems to make a lot of sense to me. As for using a function vs. an included file, HartleySan has a point, from a theory perspective. However, whether you use a function or an includable file, you only have one bit of code to ever edit. I would argue that creating a script that just defines a function and calls it is the same thing as creating an includable file that does the same work, except that if you define a function, you require a lot of extra memory overhead for something that only gets done once. Seems wasteful and unnecessary to me, but I can appreciate the desire to wrap functionality in a function. That's why I suggested creating a page that's run directly that does all the work: it seems less kludgey. Glad you figured it out!
-
Hello Matt, I think frameworks could be considered "taking the easy way out". The fallacy is in thinking that taking the easy way out is a bad thing. We all take the easy way out with all sorts of things all the time. It's up to you, the programmer, to decide whether taking the easy way out is appropriate for a given project. Now as for US foreign policy...
-
Chapter 15
Larry replied to Sara's topic in PHP 6 and MySQL 5 for Dynamic Web Sites: Visual QuickPro Guide (3rd Edition)
The reason the dates aren't showing up is because you haven't installed time zone support in MySQL. See Chapter 14, I believe. As for why only some forums work, not all forums have language keywords and/or postings, so they revert to English (per the code). -
Chapter 12 - Intro To Databases
Larry replied to Cooper's topic in PHP for the Web: Visual QuickStart Guide (4th Edition)
Yes, everywhere you cal a MySQLi function, you must change the arguments to match what's appropriate for that function. -
Chapter 12 - Intro To Databases
Larry replied to Cooper's topic in PHP for the Web: Visual QuickStart Guide (4th Edition)
And you need to expand on what you mean by "it does not work". That's too vague. How it's particularly not working is relevant for debugging purposes. -
Online Publishing - Selling Virtual Products
Larry replied to Bill's topic in Effortless E-Commerce with PHP and MySQL
Thanks to HartleySan and Paul for helping out and thanks to the original poster for the nice words on the book. -
Incrementing Not Working
Larry replied to neophyte's topic in PHP for the Web: Visual QuickStart Guide (3rd Edition)
Thank you very much for the nice words. I'm glad you like what I do!