Jump to content
Larry Ullman's Book Forums

David John

  • Content Count

  • Joined

  • Last visited

Community Reputation

1 Neutral

About David John

  • Rank

Recent Profile Visitors

382 profile views
  1. Give this a try (I am certainly no accountant, so please double-check to make sure this is how pay is deducted). And I intentionally left off overtime pay (unaware of the rate) as well as first name, last name, and net pay, but you probably get the idea. paycheck.html: <!doctype html> <html lang="en"> <head> <meta charset="utf-8"> <title>PayCheck</title> <!--[if lt IE 9]> <script src="http://html5shiv.goo...5.js"></script> <![endif]--> <script src="forum.js"></script> </head> <body> <!-- Pay
  2. Hey all, I figured I would share one of my projects inspired by Larry's effortless e-commerce book(s): https://www.broadbandguitar.com/ We offer online music lessons from incredibly talented guitarists.
  3. Larry, I have been doing some google searches and did not find a sufficient answer. Will keep trying. The answer is out there!
  4. Love the book, Larry. It has been extremely helpful to me, and I have revamped my (soon-to-be) e-commerce site to accommodate the updates that you provided in the "First Site". But one thing eludes me, and that is how to get the navbar to collapse when viewed in portrait mode on an iPad (everything works well on the iPhone). I did not use LESS for the bootstrap files, so what line of code determines the point at which the navbar collapses? Any help would be appreciated.
  5. Great tips. Definitely will take these into account. Thanks, Larry!
  6. Happy New Year! Hopefully this is the correct place to put this question. For those of you who freelance or do contract work, what is the best way to determine how much to charge clients/customers? The initial time investment and research was very high, but now that I have completed my project, I can essentially "re-use" the code, making tweaks here and there. Any advice would be appreciated.
  7. It works now (thank God!) As usual, many thanks to HartleySan and Larry for your input. Next question: I am using "airportDesignator" (from the hotels table) in the "hotels_id" column (from the information table) when the comments are submitted. Does this violate 1NF/2NF/3NF or compromise referential integrity at all?
  8. Sorry for being unclear, HartleySan. Please correct me if I'm wrong, but doesn't INSERT INTO SELECT replace the use of VALUES? I could be mistaken, but I thought this was the case. To illustrate an example of my objective, say a user wants to comment on/rate a hotel in Albany whose id = 1 in the hotels table. The GET query grabs the hotel id, the user enters his/her comments, and submits. What's inserted into the information table is the value of Albany (1) into the "hotels_id" column as well as the user's comments in the "comments" column in the information table. In addition, I h
  9. Hi, everyone. There's a project I'm working on, and I would love to get a bit of help from developers who visit this forum. Here's the background: This is an app that will allow users to post comments/reviews about hotels that they stay in. I decided to make two tables: hotels and information (for the comments). hotels table: CREATE TABLE IF NOT EXISTS `hotels` ( `id` int(10) unsigned NOT NULL AUTO_INCREMENT, `airportDesignator` varchar(11) CHARACTER SET utf8 COLLATE utf8_unicode_ci NOT NULL, `hotelName` varchar(255) NOT NULL, `address` varchar(255) CHARACTER SET utf8 COLL
  10. Not sure why, Larry, but whenever I post in this forum, I end up solving my problem! I replaced "GROUP BY" with "ORDER BY" and now I think it works. Thanks for your books and resources; I truly have learned a lot from them.
  11. Certainly. Here's the INFO table: CREATE TABLE IF NOT EXISTS `info` ( `info_id` int(10) unsigned NOT NULL AUTO_INCREMENT, `state_id` int(10) NOT NULL, `address` varchar(255) COLLATE utf8_unicode_ci NOT NULL, `city` varchar(255) COLLATE utf8_unicode_ci NOT NULL, `state` varchar(30) COLLATE utf8_unicode_ci NOT NULL, `zip` varchar(30) COLLATE utf8_unicode_ci NOT NULL, PRIMARY KEY (`info_id`) ) ENGINE=MyISAM DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci AUTO_INCREMENT=938 ; And here's the STATES table: CREATE TABLE IF NOT EXISTS `States` ( `state_id` int(10) unsigned NOT NU
  12. Guys, I am trying to output ALL cities that match the following SQL query: SELECT info.state_id, info.address, info.city, info.state, info.zip FROM info INNER JOIN States ON info.state_id = States.state_id WHERE info.state_id=:id GROUP BY info.city And unfortunately, it returns only one result. Here's the try->catch I used: try { $dbh = new PDO("mysql:host=$host;dbname=$databasename", $user, $pass); $dbh->setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_EXCEPTION); $stmt = $dbh->prepare($sql); $stmt->bindParam("id", $_GET[id]); $stmt->execute(); $cities = $stmt
  13. Larry, Thanks for the well-written tutorial on Stripe.js; I am still working on using it myself. In light of its popularity, do you think a section for Stripe implementation would be worthwhile?
  • Create New...