Jump to content

drunkelf

Members
  • Posts

    16
  • Joined

  • Last visited

Posts posted by drunkelf

  1. Hello everyone i need help again.I am reading a book that requires me to import a old sql file.WHen I do this get following error

     

    #1064 - You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'TYPE=MyISAM' at line 7

     

    mysql version 5.5.24

     

    OK so it is around line 7.this should be easy to fix but I dont know how.If you can have a look

    In Need to make this work so I can finish the book even though it is outdated

     

    -- phpMyAdmin SQL Dump
    -- version 2.6.3-pl1
    -- http://www.phpmyadmin.net
    --
    -- Host: localhost
    -- Generation Time: Aug 24, 2005 at 12:34 PM
    -- Server version: 4.1.13
    -- PHP Version: 5.0.4
    --
    -- Database: `seasons`
    --
    
    
    -- --------------------------------------------------------
    
    
    --
    -- Table structure for table `quotations`
    --
    
    
    DROP TABLE IF EXISTS `quotations`;
    CREATE TABLE `quotations` (
    `quote_id` int(10) unsigned NOT NULL auto_increment,
    `quotation` varchar(255) NOT NULL default '',
    `first_name` varchar(30) NOT NULL default '',
    `family_name` varchar(30) NOT NULL default '',
    PRIMARY KEY (`quote_id`)
    ) TYPE=MyISAM;
    
    
    --
    -- Dumping data for table `quotations`
    --
    
    
    INSERT INTO `quotations` VALUES (1, 'My disability is that I cannot use my legs. My handicap is your negative perception of that disability, and thus of me.', 'Rick', 'Hansen');
    INSERT INTO `quotations` VALUES (2, 'Life is a great surprise. I do not see why death should not be an even greater one.', 'Vladimir', 'Nabokov');
    INSERT INTO `quotations` VALUES (3, 'Money couldn''t buy friends, but you got a better class of enemy.', 'Spike', 'Milligan');
    INSERT INTO `quotations` VALUES (4, 'In the factory we make cosmetics; in the store we sell hope.', 'Charles', 'Revson');
    INSERT INTO `quotations` VALUES (5, 'Man is the only animal that blushes. Or needs to.', 'Mark', 'Twain');
    INSERT INTO `quotations` VALUES (6, 'Familiarity breeds contempt — and children.', 'Mark', 'Twain');
    INSERT INTO `quotations` VALUES (7, 'Good breeding consists in concealing how much we think of ourselves and how little we think of the other person.', 'M', 'Twain');
    INSERT INTO `quotations` VALUES (8, 'If it turns out that there is a God, I don''t think that he''s evil. But the worst that you can say about him is that basically, he''s an underachiever.', 'Woody', 'Allen');
    INSERT INTO `quotations` VALUES (9, 'I don''t want to achieve immortality through my work... I want to achieve it by not dying.', 'Woody', 'Allen');
    INSERT INTO `quotations` VALUES (10, 'A thing of beauty is a joy forever.', 'John', 'Keats');
    INSERT INTO `quotations` VALUES (11, 'Scenery is fine — but human nature is finer.', 'John', 'Keats');
    INSERT INTO `quotations` VALUES (12, 'The nice aspect about football is that, if things go wrong, it''s the manager who gets the blame.', 'Gary', 'Lineker');
    INSERT INTO `quotations` VALUES (13, 'Iron rusts from disuse; stagnant water loses its purity and in cold weather becomes frozen; even so does inaction sap the vigor of the mind.', 'Leonardo', 'da Vinci');
    INSERT INTO `quotations` VALUES (14, 'A hundred times I have thought: New York is a catastrophe, and fifty times: it is a beautiful catastrophe.', '', 'Le Corbusier');
    INSERT INTO `quotations` VALUES (15, 'Power is the great aphrodisiac.', 'Henry', 'Kissinger');
    INSERT INTO `quotations` VALUES (16, 'Injustice anywhere is a threat to justice everywhere.', 'Martin Luther', 'King');
    INSERT INTO `quotations` VALUES (17, 'Democracy is the worst form of government except all those other forms that have been tried from time to time.', 'Winston', 'Churchill');
    INSERT INTO `quotations` VALUES (18, 'Love, friendship, respect do not unite people as much as common hatred for something.', 'Anton', 'Chekhov');
    INSERT INTO `quotations` VALUES (19, 'Everything''s got a moral, if only you can find it.', 'Lewis', 'Carroll');
    INSERT INTO `quotations` VALUES (20, 'The greatest happiness of the greatest number is the foundation of morals and legislation.', 'Jeremy', 'Bentham');
    INSERT INTO `quotations` VALUES (21, 'There''s a hell of a distance between wise-cracking and wit. Wit has truth in it; wise-cracking is simply callisthenics with words.', 'Dorothy', 'Parker');
    INSERT INTO `quotations` VALUES (22, 'Summers pleasures they are gone like to visions every one.', 'John', 'Clare');
    INSERT INTO `quotations` VALUES (23, 'Under the cherry —\r\nblossom soup,\r\nblossom salad', 'Matsuo', 'Basho');
    INSERT INTO `quotations` VALUES (24, 'No spring, nor summer beauty hath such grace,\r\nAs I have seen in one autumnal face', 'John', 'Donne');
    INSERT INTO `quotations` VALUES (25, 'Sweet lovers love the spring.', 'William', 'Shakespeare');
    INSERT INTO `quotations` VALUES (26, 'O, Wind,\r\nIf Winter comes, can Spring be far behind?', 'Percy Bysshe', 'Shelley');
    INSERT INTO `quotations` VALUES (27, 'In the spring a young man''s fancy lightly turns to thoughts of love', 'Alfred, Lord', 'Tennyson');
    INSERT INTO `quotations` VALUES (28, 'It is not spring until you can plant your foot on twelve daisies.', '', 'Proverb');
    INSERT INTO `quotations` VALUES (29, 'The way to ensure summer in England is to have it framed and glazed in a comfortable room.', 'Horace', 'Walpole');
    INSERT INTO `quotations` VALUES (30, '’Tis the last rose of summer\r\nLeft blooming alone\r\nAll her lovely companions\r\nAre faded and gone', 'Thomas', 'Moore');
    INSERT INTO `quotations` VALUES (31, 'Shall I compare thee to a summer''s day?\r\nThou art more lovely and temperate', '', 'Shakespeare');
    INSERT INTO `quotations` VALUES (32, 'Now is the winter of our discontent\r\nMade glorious summer by this sun of York', '', 'Shakespeare');
    INSERT INTO `quotations` VALUES (33, 'Blow, blow, thou winter wind,\r\nThou art not so unkind\r\nAs man''s ingratitude', 'W', 'Shakespeare');
    INSERT INTO `quotations` VALUES (34, 'My age is as a lusty winter, frosty, but kindly.', 'William', 'Shakespeare');
    INSERT INTO `quotations` VALUES (35, 'The first fall of snow is not only an event, but it is a magical event. You go to bed in one kind of world and wake up to find yourself in another quite different...', 'JB', 'Priestley');
    INSERT INTO `quotations` VALUES (36, 'Therefore all seasons shall be sweet to thee.', 'Samuel Taylor', 'Coleridge');
    INSERT INTO `quotations` VALUES (37, 'The frost performs its secret ministry,\r\nUnhelped by any wind', 'Samuel Taylor', 'Coleridge');
    INSERT INTO `quotations` VALUES (38, 'And then my heart with pleasure fills,\r\nAnd dances with the daffodills', 'William', 'Wordsworth');
    INSERT INTO `quotations` VALUES (39, 'Oh, my Luve''s like a red, red rose\r\nThat''s newly sprung in June', 'Robert', 'Burns');
    INSERT INTO `quotations` VALUES (40, 'Season of mists and mellow fruitfulness,\r\nClose bosom-friend of the maturing sun', 'John', 'Keats');
    INSERT INTO `quotations` VALUES (41, 'The coming musk rose, full of dewy wine,\r\nThe murmurous haunt of flies on summer eves', 'John', 'Keats');
    INSERT INTO `quotations` VALUES (42, 'Snowy, Flowy, Blowy,\r\nShowery, Flowery, Bowery,\r\nHoppy, Croppy, Droppy,\r\nBreezy, Sneezy, Freezy', 'George', 'Ellis');
    INSERT INTO `quotations` VALUES (43, 'Mais où sont les neiges d''antan? (But where are the snows of yesteryear?)', 'François', 'Villon');
    INSERT INTO `quotations` VALUES (44, 'Summer time an'' the livin'' is easy,\r\nFish are jumpin'' and the cotton is high', 'Heyward &', 'Gershwin');
    INSERT INTO `quotations` VALUES (45, 'I never think of the future. It comes soon enough.', 'Albert', 'Einstein');
    INSERT INTO `quotations` VALUES (46, 'The English never smash in a face. They merely refrain from asking it to dinner.', 'Margaret', 'Halsey');
    INSERT INTO `quotations` VALUES (47, 'Once the toothpaste is out of the tube, it is awfully hard to get back in.', 'HR', 'Haldeman');
    INSERT INTO `quotations` VALUES (48, 'Le sens commun est fort rare. (Common sense is not so common.)', '', 'Voltaire');
    INSERT INTO `quotations` VALUES (49, 'I hate television. I hate it as much as peanuts. But I can''t stop eating peanuts.', 'Orson', 'Welles');
    INSERT INTO `quotations` VALUES (50, 'I always say, keep a diary and some day it''ll keep you.', 'Mae', 'West');
    

  2. it works baby!sadly my book by david powers uses difrrint versions of these programs but he did say to install the latest versions availible so I am sure that I will be able to make sense of it.This wamp server thingy is so cool so easy.You can close the thead now

  3. yes that I am sure off.I will go through all the "adjustments" I made to php.ini when I first "installed" it otherwise I will use another pc.I am thinking instead of installing php 5 because that is the one used it my book I will install the latest and instead of installing phpmyadmin 2.6.4.p1 I will install the latest I am also going to use a windows installer instead of copying files like david powers told me too.

     

    Hopefully I can follow the book using diffrint versions of these programs

  4. I followed all of the instructions and it still does not work.Here is the instructions

     

    here is my error

     

     

    cannot load mysql extension;

    please check PHP configuration

     

     

    <snip mod: removed hundreds of lines of copy/pasted phpmyadmin instructions and phpmyadmin config file>

  5. I quaote

     

     

    When you pass an argument to the function, a local copy is made in the function to

    store the value. Any changes made to that value affect only the local copy of the variable

    in the function, not the source of the parameter. You can define parameters that

    modify the source variable by defining reference parameters.

    Reference parameters define references by placing an ampersand (&) directly before

    the parameter in the function’s definition.

     

    some code

     

    <?php
    function capitalize( &$str, $each=TRUE )
    { // First, convert all characters to lowercase
    $str = strtolower($str);
    if ($each === true) {
    $str = ucwords($str);
    } else {
    $str{0} = strtoupper($str{0});
    }
    }
    $str = "hEllo WoRld!";
    capitalize( $str );
    echo $str;
    ?>
    

     

    Ok I do not undestand reference parameters.CAn sombody help me out.I am going to continue with other lessons but would like to have a better understanding of this reference parameters.Thanks

  6. SO I am learing to code php by hand the same time I am learning how to use it in dreamweaver.By hand I am working with very basic stuff but a script that comes straight from the book does not work.It os very simple little block of code but what is wrong with it.If the code in the book itself is faulty then I cant learn so please help me with this I need to learn these things so I can understand it myself

     

    <?php
    echo "Executing line " . __LINE__ . " of PHP script " . __FILE_ _ . ".";
    ?>
    

  7. You are trying to referencing an array index that doesn't exist. I assume this is happening when you load the page before you submit the form. That is a warning that should be suppressed in a production environment but is good to have on in a development environment. However, I typically use something such as below for any fields submitted in a form to work around such errors.

     

    $name = isset($_POST['name']) ? trim($_POST['name']) : '';

    You are trying to referencing an array index that doesn't exist. I assume this is happening when you load the page before you submit the form. That is a warning that should be suppressed in a production environment but is good to have on in a development environment. However, I typically use something such as below for any fields submitted in a form to work around such errors.

     

    $name = isset($_POST['name']) ? trim($_POST['name']) : '';

     

    OK i think I understand what you mean so where do I type in the code you gave me.IF you can tell me where I should put the code I think I will understand better

  8. WHen I add this bit of code I get an error

     

     

    $name = trim($_POST['name']);
    if (empty($name)) {
    $error['name'] = 'Please enter your name';
    }
    

    Notice: Undefined index: name in C:\htdocs\phpdw\contact.php on line 24

     

    it is suppose to check whether the form for name is empty or not.The text field has a name and id of name.here is the rest of the code most of it irrevelant.Can somebody help me with this?

     

     

     

    <?php
    if (array_key_exists('ewComments', $_POST)) {
    // mail processing script
    // initialize variables
    $to = 'heunesc@gmail.com'; // use your own email address
    $subject = 'Feedback from East-West Seasons';
    // build the message
    $message = 'From: '.$_POST['name']."\n\n";
    $message .= 'Email: '.$_POST['email']."\n\n";
    $message .= 'Comments: '.$_POST['message'];
    // send the email
    // remove escape characters from POST array
    mail($to, $subject, $message);
    }
    // remove escape characters from POST array
    if (get_magic_quotes_gpc()) {
     function stripslashes_deep($value) {
       $value = is_array($value) ? array_map('stripslashes_deep', $value) : stripslashes($value);
       return $value;
       }
     $_POST = array_map('stripslashes_deep', $_POST);
     }
    
    $name = trim($_POST['name']);
    if (empty($name)) {
    $error['name'] = 'Please enter your name';
    }
    
    ?>
    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd
    <html xmlns="http://www.w3.org/1999/xhtml">
    <head>
    <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
    <title>east west seasons</title>
    <?php /*include('style_rules.php');*/ ?>
    
    <script type="text/Javascript">
    <!--
    function MM_findObj(n, d) { //v4.01
     var p,i,x;  if(!d) d=document; if((p=n.indexOf("?"))>0&&parent.frames.length) {
       d=parent.frames[n.substring(p+1)].document; n=n.substring(0,p);}
     if(!(x=d[n])&&d.all) x=d.all[n]; for (i=0;!x&&i<d.forms.length;i++) x=d.forms[i][n];
     for(i=0;!x&&d.layers&&i<d.layers.length;i++) x=MM_findObj(n,d.layers[i].document);
     if(!x && d.getElementById) x=d.getElementById(n); return x;
    }
    
    function MM_validateForm() { //v4.0
     var i,p,q,nm,test,num,min,max,errors='',args=MM_validateForm.arguments;
     for (i=0; i<(args.length-2); i+=3) { test=args[i+2]; val=MM_findObj(args[i]);
       if (val) { nm=val.name; if ((val=val.value)!="") {
         if (test.indexOf('isEmail')!=-1) { p=val.indexOf('@');
           if (p<1 || p==(val.length-1)) errors+='- '+nm+' must contain an e-mail address.\n';
         } else if (test!='R') { num = parseFloat(val);
           if (isNaN(val)) errors+='- '+nm+' must contain a number.\n';
           if (test.indexOf('inRange') != -1) { p=test.indexOf(':');
             min=test.substring(8,p); max=test.substring(p+1);
             if (num<min || max<num) errors+='- '+nm+' must contain a number between '+min+' and '+max+'.\n';
       } } } else if (test.charAt(0) == 'R') errors += '- '+nm+' is required.\n'; }
     } if (errors) alert('The following error(s) occurred:\n'+errors);
     document.MM_returnValue = (errors == '');
    }
    //-->
    </script>
    </head>
    
    <body>
    <div id="wrapper">
     <div id="titlebar"><img src="" alt="east west season" name="bluebellstop" width="738" height="32" id="bluebellstop" style="background-color: #00CC99" /></div>
     <div id="Main content">
       <div id="nav">
         <ul>
           <li id="thispage"><a href="index.php">Home</a></li>
           <li><a href="index.php">News</a></li>
           <li><a href="index.php">BLog</a></li>
           <li><a href="index.php">Gallery</a></li>
           <li><a href="index.php">Contact</a></li>
         </ul>
       </div>
       <h1>send us your comments</h1>
       <p>Duis aute irure dolor ut labore et dolore magna aliqua. Quis nostrud exercitation sunt in culpa lorem ipsum dolor sit amet. Excepteur sint occaecat ullamco laboris nisi ut labore et dolore magna aliqua. In reprehenderit in voluptate quis nostrud exercitation qui officia deserunt. </p><form action="<?php $_SERVER['PHP_SELF'];?>" method="post" name="Contact form" id="Contact form" onsubmit="MM_validateForm('name','','R','email','','NisEmail','message','','R');MM_validateForm('name','','R','email','','RisEmail','message','','R');return document.MM_returnValue">
         <p>
           <label for="name">name:</label>
           <br />
           <input type="text" name="name" id="name" />
         </p>
         <p>
           <label for="email">email</label>
           <br />
           <input type="text" name="email" id="email" />
         </p>
         <p>
           <label for="message">message<br />
           </label>
           <textarea name="message" cols="60" rows="6" id="message"></textarea>
         </p>
         <p>
           <input name="ewcomments" type="submit" id="ew comments" value="send comments" />
         </p>
       </form>
       <p> </p>
       <div id="footer">
     <?php include('copyright.php'); ?>
     </div>
    
     </div>
    </div>
    </body>
    </html>
    

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.