Jump to content
Larry Ullman's Book Forums

Larry

Administrators
  • Posts

    5413
  • Joined

  • Last visited

  • Days Won

    155

Posts posted by Larry

  1. Okay, so fundamentally the users table should identify the user and allow them to login (i.e., store login credentials). I wouldn't assign a single type in the users table b/c users don't have a single type in your scenario; they're type is defined by context. If you need to do something for or with a group of people--email all the parents, create teacher-specific pages--then you'll want to have an easy way to identify "is a teacher" or "is a parent" (but without limiting a user to being just one thing). My inclination would be to create three 1/0 TINYINTs: student, teacher, parent. A student would likely be 1, 0, 0 for those columns whereas a teacher would likely be 0, 1, 0 or 0, 1, 1. Using this approach you have flexibility as to how you refer to people or access lists of groups.

  2. More information is needed to answer this. Can the users log into the site? I presume a teacher could also be a parent but can a parent or a teacher also be a student?

    In general, the user as a concept is a way of identifying a person. A user may also be a way to identify functionality (e.g., log in). But the user's type in your case may not be a static, singular thing but rather be a description of the relationship that user has to another user (e.g., teacher A may teach student B but also be a parent to student C). 

  3. 1) You'd store the keywords in the database along with the product info. Then you'd retrieve the product details before including the header file, making those keywords available to the header file to put in a META tag. 

    2) You'd need to track the user's viewing history and then you can pull from there. So when a user views a product, that stores the product ID, user identifier, and timestamp in a table. When that same user identifier appears, you can pull the info from that table by date desc order.

  4. Sorry for the delay; I had to reinstall XAMPP on Windows to test this out. I suspect the issue you're having is because you haven't connected Mercury to the Internet at large. In other words, Mercury needs an SMTP server to work with. This is normally your local ISP or something like smtp.google.com (if you have a Gmail account). Have you done that?

    This page is pretty good, by the way: https://www.open-emr.org/wiki/index.php/Mercury_Mail_Configuration_in_Windows

  5. Ah, great! Glad you're making progress and thanks for letting us know! Just to be clear, you should never mix procedural and OOP approaches like that as you won't necessarily get the errror messages, let alone the results, you're looking for.

    As for your question, if a query must affect one or more rows, than checking for that is perfect. But if a query won't necessarily affect multiple rows than you can confirm that it worked--or that it didn't fail--by either checking the truthiness of the query result or by checking for the presence of an error. 

×
×
  • Create New...