Jump to content
Larry Ullman's Book Forums

Larry

Administrators
  • Posts

    5413
  • Joined

  • Last visited

  • Days Won

    155

Posts posted by Larry

  1. 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.

  2. "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.

  3. 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.

  4. 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!

  5. 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...

×
×
  • Create New...