Jump to content
Larry Ullman's Book Forums

Larry

Administrators
  • Content Count

    5091
  • Joined

  • Last visited

  • Days Won

    142

Larry last won the day on December 18 2018

Larry had the most liked content!

Community Reputation

421 Excellent

About Larry

  • Rank
    Administrator/Writer

Recent Profile Visitors

The recent visitors block is disabled and is not being shown to other users.

  1. I imagine it _may_ be possible but it's the kind of situation where I feel like the answer is "this is probably not what you should be doing". In that it feels like you're only using PHP here because you're most comfortable with it. If you're starting with C++, my inclination would be to try to do all the work in C++. But let me know if I'm missing something.
  2. If you put the file in a folder named "ch01" then the URL would be http://localhost/ch01/first.php.
  3. There could be several reasons why. To debug it, you'll want to take the src value for the img (from the browser HTML source) and run that directly in a browser to see what, if any, PHP error is reported.
  4. Thanks for the information! Could you clarify what edition and version (e.g., print) you're using? Thanks!
  5. Hmmm... you could put the error suppression operator before mail() calls, although you could also just comment out the mail() calls, for that matter.
  6. What's the actual problem you're having? What errors are you seeing, if any? All that being said, there's kind of a lot of problems with that code from a design standpoint. Way too much undocumented magic going on. The dynamic fetching of specific fields is dubious.
  7. You either initialize the variables before you reference them or maybe they should be coming from an HTML form.
  8. That means your SELECT query isn't working. You'll need to run it separately on the server to see what the results are (i.e., what the error is).
  9. Sorry for the delay. I wanted to remind myself of why I did what I did...which I may now remember. Maybe! I'm still a little bit confused b/c the page numbers you reference for the "Effortless E-Commerce" book don't match up with those in the printed copy of the 2nd edition. But I think I get what's going on...by looking at the SQL commands for the second example in the "Effortless E-Commerce" book, (which is the one with "customers" and "orders" tables). Foreign keys are a (normalized) database concept, in which a column in table A represents a column from table B. There are also foreign key *constraints*, which is an aspect of the database application, enforcing the existence of a foreign key. This is what you're seeing on page 197- in the "PHP and MySQL" book. The SQL in the "Effortless E-Commerce" book has foreign keys but not foreign key constraints. There's a tip on page 193 that says you could add these. As a rule, a database must have foreign keys in order to use foreign key constraints but a database can have foreign keys without foreign key constraints. Separately, and perhaps the confusion here, MySQL will use the word "KEY" as synonymous with "INDEX". This is just saying that MySQL should index--i.e., track--the values in that column. Because, as a good rule, you should index foreign key columns. So! The reason everything seems to be behaving differently for the "Effortless E-Commerce" tables is because they don't have foreign key *constraints*. Let me know if this is still not clear or if you have any other questions (and I'll reply more promptly, I promise!).
  10. Good question! Actors have a many-to-many relationship with movies because each actor can be in multiple movies and each movie has multiple actors. A rule in this model is that each movie only has a single director, so there's a one-to-many relationship between directors and movies (although in real life some movies have more than one director these days).
  11. Well, different technologies go through trends although that tends to be more impactful to new businesses and work b/c, say, an existing PHP company/site is going to need a PHP person. We're definitely in a time wherein there's a lot of talk about server-side JavaScript. That may stay or go, though. And it's totally fine. I think all arguments about X language encouraging bad code are pretty silly. You can be a good or bad programmer in any language! Your best bet would be to look at some actual job markets, whether it's for full time jobs or freelance work, and see what they're actually looking for. I suspect you'll find no clear winner or loser. For what it's worth, generally speaking companies with existing IT departments will likely have opinions on what tech they want to hire for, but on the other hand, I work for a company that's primarily a Ruby shop and they hire more than just Ruby developers. If you're a good developer in any one language, there's potential for you to be a good developer in another. Developers understand theories and practices; languages are largely a matter of specific syntax. Finally, in my previous experience, many of the people hiring a developer for a project don't know or care what tech you use so long as you can do the job at the right price.
  12. What operating system are you using? Generally, though, I don't worry about trying email locally and just wait to test that stuff using a hosted server.
  13. You're getting this error because the $row variable doesn't have an element indexed at "description". $row comes from the stored procedure, so either there's likely a flaw in your stored procedure definition.
×
×
  • Create New...