Jump to content
Larry Ullman's Book Forums

guvna

Members
  • Content Count

    16
  • Joined

  • Last visited

Community Reputation

0 Neutral

About guvna

  • Rank
    Newbie
  1. I'm aware why I'm getting the warning. Do you mean change my entire website as every page includes the header file and will therefore echo the page title. For example remove the echo and hard code the <html> <title> tag? If there is an example of how such as page should be structured I would be grateful for direction.
  2. In chapter 3.2 the code was introduced: <title><?php echo $page_title; ?></title> Having now contructed a website based on this I'm having error now using the header() function such as redirecting and form submission. Each page includes the header file and defines the page title: // include the header file: include ('../includes/my_header.inc.php'); // Create the page title: $page_title = 'My Page Title'; //line #13 Whenever I use the header() now I get this error: Warning: Cannot modify header information - headers already sent by (output
  3. Placing this in 4th Edition as that's the book I'm working through. I've created a form with three inputs (Agent, Guest, Email) but Agent is not required. I'm trying to display different messages whether Agent is input or not but cannot get that part to work. I know the reset button doesn't work but that's just as the form was copied from an old html page. I'll get into field content validation once I can get past this stage as I have multiple fields to add but need to display different messages on form submission dependent on which fields get completed. <!DOCTYPE HTML> <html&g
  4. Need some directions with this question please: in login.php we have: // Assign $data to $errors for login_page.inc.php: $errors = $data; and in login_page.inc.php we have: // Print any error messages , if they exist: if (isset($errors) && !empty($errors)) { echo '<h1>Error!</h1> <p class="error">The following error(s) occurred:<br />'; foreach ($errors as $msg) { echo " - $msg<br />\n"; } // End of foreach. echo '<\p><p>Please try again.</p>'; /
  5. Larry, 'guilty as charged'. User error. Script 12.7 line 20: if ( (isset I had: if ( (!isset and only realized when I changed the script in 12.10. Humble apologies.
  6. There is a similar posting but they don't have id's so that was the topic title 'Chap 12 - 12.6 Example' which doesn't look like it was resolved. Due to the advances in web browsers I can't review the cookies as per the example K on page 387. First of all, on script 12.7, there seems to be a typo on line 3: <head"> (the double quotation mark). When I first load index.php the header.html displays Logout which seems strange as I haven't logged in yet. Selecting Logout takes me back to index.php and the header.html is still displaying Logout. When I load login.php directly I ca
  7. Script 10#4 works for pagination, in my case 6 pages. Script 10#5 sort on First Name and Last Name work on the initial page display after selected column heading but not for selecting pages after the sort selection. My url shows view_users_3.php as I save each iteration of the scripts to review. Viewing my page then selecting sort by last name shows: url = view_users_3.php?sort=ln The first page of results displays correctly by last name. selecting the page 2: url = view_users_3.php?s=10&p=6&sortln The second page of results is showing user_id's 10 to 19 so has not
  8. it might be a MySQL Workbench thing as I can right click the BLOB icon then left click 'open in viewer' then see the result '1234' in the text tab.
  9. Scripts 1, 2 and 3 from page 238 all work fine. When I run script 4 on page 239 and run: SELECT 8 FROM customers WHERE customer_id=1; the table displays 'BLOB' in the pin field rather than the expected '1234'. I did look up BLOB erros and my character set is definately utf8 with collation utf8 general ci.
  10. I've shown the error to a friend who works with Microsoft SQL and he suggests the syntax in the book is missing some elements. Below is code that he suggested to try and it works. MAX is just an example to show the code working: SELECT MAX(f.name), COALESCE(MAX(m.date_entered), 'N/A') AS last_post FROM forums AS f LEFT JOIN messages AS m USING (forum_id) GROUP BY (m.forum_id) ORDER BY MAX(m.date_entered) DESC;
  11. OK so the alias AS I get. The m.messages relates to the table for the 'AS m' part. The fact that you use m for messages table, f for forum table could just as easily be x and y?
  12. Page 220 syntax: SELECT f.name, COALESCE(MAX(m.date_entered), 'N/A') AS last_post FROM forums AS f -- my tablename is 'forums'. LEFT JOIN messages AS m USING (forum_id) GROUP BY (m.forum_id) ORDER BY m.date_entered DESC; Results in this error: #1055 - Expression #1 of SELECT list is not in GROUP BY clause and contains nonaggregated column 'rich_forum.f.name' which is not functionally dependent on columns in GROUP BY clause; this is incompatible with sql_mode=only_full_group_by
×
×
  • Create New...