light87 Posted March 12, 2012 Share Posted March 12, 2012 Hello: I'm having problems with a newsfeed. More specifically, it is a "Test Drive" exercise for the book "Head First Php and MySQL" by Beighly and Morrison on page 675. The website that I use does not try to sell anything and is only used as a test site. There are 6 files associated with this exercise. The SQL file is: CREATE TABLE `aliens_abduction` ( `abduction_id` INT AUTO_INCREMENT, `first_name` VARCHAR(30), `last_name` VARCHAR(30), `when_it_happened` DATE, `how_long` VARCHAR(30), `how_many` VARCHAR(30), `alien_description` VARCHAR(100), `what_they_did` VARCHAR(100), `fang_spotted` VARCHAR(10), `other` VARCHAR(100), `email` VARCHAR(50), PRIMARY KEY (`abduction_id`) ); INSERT INTO `aliens_abduction` VALUES (1, 'Alf', 'Nader', '2000-07-12', 'one week', 'at least 12', 'It was a big non-recyclable shiny disc full of what appeared to be mutated labor union officials.', 'Swooped down from the sky and snatched me up with no warning.', 'no', 'That\'s it.', 'ralph@nader.com'); INSERT INTO `aliens_abduction` VALUES (2, 'Don', 'Quayle', '1991-09-14', '37 seconds', 'dunno', 'They looked like donkeys made out of metal with some kind of jet packs attached to them.', 'I was sitting there eating a baked potatoe when "Zwoosh!", this beam of light took me away.', 'yes', 'I really do love potatos.', 'dq@iwasvicepresident.com'); INSERT INTO `aliens_abduction` VALUES (3, 'Rick', 'Nixon', '1969-01-21', 'nearly 4 years', 'just one', 'They were pasty and pandering, and not very forgiving.', 'Impeached me, of course, then they probed me.', 'no', 'I\'m lonely.', 'rnixon@not'); INSERT INTO `aliens_abduction` VALUES (4, 'Belita', 'Chevy', '2008-06-21', 'almost a week', '27', 'Clumsy little buggers, had no rhythm.', 'Tried to get me to play bad music.', 'no', 'Looking forward to playing some Guitar Wars now that I\'m back.', 'belitac@rockin.net'); INSERT INTO `aliens_abduction` VALUES (5, 'Sally', 'Jones', '2008-05-11', '1 day', 'four', 'green with six tentacles', 'We just talked and played with a dog', 'yes', 'I may have seen your dog. Contact me.', 'sally@gregs-list.net'); INSERT INTO `aliens_abduction` VALUES (6, 'Meinhold', 'Ressner', '2008-08-10', '3 hours', 'couldn\'t tell', 'They were in a ship the size of a full moon.', 'Carried me to the top of a mountain and dropped me off.', 'no', 'Just want to thank those fellas for helping me out.', 'meinhold@icanclimbit.com'); INSERT INTO `aliens_abduction` VALUES (7, 'Mickey', 'Mikens', '2008-07-11', '45 minutes', 'hundreds', 'Huge heads, skinny arms and legs', 'Read my mind,', 'yes', 'I\'m thinking about designing a helmet to thwart future abductions.', 'mickey@stopreadingmymind.net'); INSERT INTO `aliens_abduction` VALUES (8, 'Shill', 'Watner', '2008-07-05', '2 hours', 'don\'t know', 'There was a bright light in the sky, followed by a bark or two.', 'They beamed me toward a gas station in the desert.', 'yes', 'I was out of gas, so it was a pretty good abduction.', 'shillwatner@imightbecaptkirk.com'); The X_Database_Chapter12_Page675_connectvars_final.php file is: <?php //3,08,12 //Filename:C:,HeadFirst_PHP_MYSQL,Chapter12, //X_Database_Chapter12_Page675_connectvars_final.php // Define database connection constants define('DB_HOST', 'KEPTPRIVATE'); define('DB_USER', 'KEPTPRIVATE'); define('DB_PASSWORD', 'KEPTPRIVATE'); define('DB_NAME', 'KEPTPRIVATE'); ?> The css file is: /* Filename:C:,HeadFirst_PHP_MYSQL,Chapter12, X_Database_Chapter12_Page675_style_final.css */ .error { font-weight:bold; color:#FF0000; } table { border:1px solid #DDDDDD; border-collapse:collapse; } tr.heading { font-size:large; color:#006600; } td { border:1px solid #DDDDDD; } form label { display:inline-block; width:225px; font-weight:bold; } a { text-decoration:none; font-weight:bold; } a:link { color:#006600; } a:hover { background-color:#EEEEEE; } a:visited { color:#002200; } a:active { color:#009900; } 17763_.php 17764_.php 17765_.php Quote Link to comment https://forums.phpfreaks.com/topic/258758-problems-with-a-news-feed/ Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.