Professional Web Applications Themes

Can someone explain this MySQL code fragment - MySQL

What does the this bit of code do? I LOCK TABLES `phplist_listattr_comments` WRITE; UNLOCK TABLES; I'm learning PHP/Mysql running on a cheap shared server LAMP service and the setup script is barfing on the above command. The books I have don't explain this in terms I understand. FWIW, the MySQL server I'm using is MyISAM. Thanks. One of these days I'll have this stuff figured out. CREATE TABLE `phplist_listattr_comments` ( `id` int(11) NOT NULL auto_increment, `name` varchar(255) default NULL, `listorder` int(11) default '0', PRIMARY KEY (`id`), UNIQUE KEY `name` (`name`)) TYPE=MyISAM; ---- Dumping data for table `phplist_listattr_comments`-- /*!40000 ALTER TABLE ...

  1. #1

    Default Can someone explain this MySQL code fragment





    What does the this bit of code do? I

    LOCK TABLES `phplist_listattr_comments` WRITE;
    UNLOCK TABLES;

    I'm learning PHP/Mysql running on a cheap shared server LAMP service
    and the setup script is barfing on the above command. The books I
    have don't explain this in terms I understand. FWIW, the MySQL server I'm
    using is MyISAM.

    Thanks. One of these days I'll have this stuff figured out.



    CREATE TABLE `phplist_listattr_comments` ( `id` int(11) NOT NULL
    auto_increment, `name` varchar(255) default NULL, `listorder` int(11)
    default '0', PRIMARY KEY (`id`), UNIQUE KEY `name` (`name`))
    TYPE=MyISAM;

    ---- Dumping data for table `phplist_listattr_comments`--

    /*!40000 ALTER TABLE `phplist_listattr_comments` DISABLE KEYS */;
    LOCK TABLES `phplist_listattr_comments` WRITE;
    UNLOCK TABLES;
    /*!40000 ALTER TABLE `phplist_listattr_comments` ENABLE KEYS */;

    --
    a d y k e s p a n i x . c o m

    Don't blame me. I voted for Gore.
    Al Dykes Guest

  2. #2

    Default Re: Can someone explain this MySQL code fragment

    -----BEGIN PGP SIGNED MESSAGE-----
    Hash: SHA1

    Al Dykes schrieb:
    > What does the this bit of code do? I
    >
    > LOCK TABLES `phplist_listattr_comments` WRITE;
    > UNLOCK TABLES;
    >
    Well its doing exactly what it says. It locks the table
    phplist_listattr_comments for WRITE, this means nobody but this process
    is able to write to this table. And then it unlocks it.
    > I'm learning PHP/Mysql running on a cheap shared server LAMP service
    > and the setup script is barfing on the above command. The books I
    > have don't explain this in terms I understand. FWIW, the MySQL server I'm
    > using is MyISAM.
    >
    > Thanks. One of these days I'll have this stuff figured out.
    >
    >
    >
    > CREATE TABLE `phplist_listattr_comments` ( `id` int(11) NOT NULL
    > auto_increment, `name` varchar(255) default NULL, `listorder` int(11)
    > default '0', PRIMARY KEY (`id`), UNIQUE KEY `name` (`name`))
    > TYPE=MyISAM;
    >
    > ---- Dumping data for table `phplist_listattr_comments`--
    >
    > /*!40000 ALTER TABLE `phplist_listattr_comments` DISABLE KEYS */;
    > LOCK TABLES `phplist_listattr_comments` WRITE;
    > UNLOCK TABLES;
    > /*!40000 ALTER TABLE `phplist_listattr_comments` ENABLE KEYS */;
    >
    In this it seems to do nothing because there is nothing between locking
    and unlocking.

    Regards
    Stefan
    -----BEGIN PGP SIGNATURE-----
    Version: GnuPG v1.4.2 (MingW32)

    iD8DBQFD7Q8IyeCLzp/JKjARApG1AKCxhdTUX8oADx4WfiuYNuk7K1vM9ACdG4Uz
    txpXJK0Fh3/CcnZAL240SBk=
    =qsvR
    -----END PGP SIGNATURE-----
    Stefan Rybacki Guest

  3. #3

    Default Re: Can someone explain this MySQL code fragment

    "Stefan Rybacki" <stefan.rybackigmx.net> wrote in message
    news:454h85F4vta3U1individual.net...
    >> CREATE TABLE `phplist_listattr_comments` ( `id` int(11) NOT NULL
    >> auto_increment, `name` varchar(255) default NULL, `listorder` int(11)
    >> default '0', PRIMARY KEY (`id`), UNIQUE KEY `name` (`name`))
    >> TYPE=MyISAM;
    >>
    >> ---- Dumping data for table `phplist_listattr_comments`--
    >>
    >> /*!40000 ALTER TABLE `phplist_listattr_comments` DISABLE KEYS */;
    >> LOCK TABLES `phplist_listattr_comments` WRITE;
    >> UNLOCK TABLES;
    >> /*!40000 ALTER TABLE `phplist_listattr_comments` ENABLE KEYS */;
    >>
    >
    > In this it seems to do nothing because there is nothing between locking
    > and unlocking.
    The code looks like the output of mysqldump, the MySQL backup tool.

    If there had been any data in the table when the mysqldump was run, it would
    have generated a bunch of INSERT statements in between the LOCK and the
    UNLOCK.

    Regards,
    Bill K.


    Bill Karwin Guest

  4. #4

    Default Re: Can someone explain this MySQL code fragment

    In article <dsjgtc0d0oenews3.newsguy.com>,
    Bill Karwin <billkarwin.com> wrote:
    >"Stefan Rybacki" <stefan.rybackigmx.net> wrote in message
    >news:454h85F4vta3U1individual.net...
    >>> CREATE TABLE `phplist_listattr_comments` ( `id` int(11) NOT NULL
    >>> auto_increment, `name` varchar(255) default NULL, `listorder` int(11)
    >>> default '0', PRIMARY KEY (`id`), UNIQUE KEY `name` (`name`))
    >>> TYPE=MyISAM;
    >>>
    >>> ---- Dumping data for table `phplist_listattr_comments`--
    >>>
    >>> /*!40000 ALTER TABLE `phplist_listattr_comments` DISABLE KEYS */;
    >>> LOCK TABLES `phplist_listattr_comments` WRITE;
    >>> UNLOCK TABLES;
    >>> /*!40000 ALTER TABLE `phplist_listattr_comments` ENABLE KEYS */;
    >>>
    >>
    >> In this it seems to do nothing because there is nothing between locking
    >> and unlocking.
    >
    >The code looks like the output of mysqldump, the MySQL backup tool.
    >
    >If there had been any data in the table when the mysqldump was run, it would
    >have generated a bunch of INSERT statements in between the LOCK and the
    >UNLOCK.
    >
    >Regards,
    >Bill K.
    >
    >

    Thank you. That was a long script that created similar code for a
    bunch of tables and I picked this one at random. Others did have an
    insert statement with data.


    When I tried to run the script in a window in myphpadmin the
    lock/unlock verbiage died. Why ?

    Thanks.



    --
    a d y k e s p a n i x . c o m

    Don't blame me. I voted for Gore.
    Al Dykes Guest

  5. #5

    Default Re: Can someone explain this MySQL code fragment

    Al Dykes wrote:
    > In article <dsjgtc0d0oenews3.newsguy.com>,
    > Bill Karwin <billkarwin.com> wrote:
    >
    >>"Stefan Rybacki" <stefan.rybackigmx.net> wrote in message
    >>news:454h85F4vta3U1individual.net...
    >>
    >>>>CREATE TABLE `phplist_listattr_comments` ( `id` int(11) NOT NULL
    >>>>auto_increment, `name` varchar(255) default NULL, `listorder` int(11)
    >>>>default '0', PRIMARY KEY (`id`), UNIQUE KEY `name` (`name`))
    >>>>TYPE=MyISAM;
    >>>>
    >>>>---- Dumping data for table `phplist_listattr_comments`--
    >>>>
    >>>>/*!40000 ALTER TABLE `phplist_listattr_comments` DISABLE KEYS */;
    >>>>LOCK TABLES `phplist_listattr_comments` WRITE;
    >>>>UNLOCK TABLES;
    >>>>/*!40000 ALTER TABLE `phplist_listattr_comments` ENABLE KEYS */;
    >>>>
    >>>
    >>>In this it seems to do nothing because there is nothing between locking
    >>>and unlocking.
    >>
    >>The code looks like the output of mysqldump, the MySQL backup tool.
    >>
    >>If there had been any data in the table when the mysqldump was run, it would
    >>have generated a bunch of INSERT statements in between the LOCK and the
    >>UNLOCK.
    >>
    >>Regards,
    >>Bill K.
    >>
    >>
    >
    >
    >
    > Thank you. That was a long script that created similar code for a
    > bunch of tables and I picked this one at random. Others did have an
    > insert statement with data.
    >
    >
    > When I tried to run the script in a window in myphpadmin the
    > lock/unlock verbiage died. Why ?
    >
    > Thanks.
    >
    >
    >
    What version of MySQL are you running?

    --
    ==================
    Remove the "x" from my email address
    Jerry Stuckle
    JDS Computer Training Corp.
    [email]jstucklexattglobal.net[/email]
    ==================
    Jerry Stuckle Guest

  6. #6

    Default Re: Can someone explain this MySQL code fragment

    "Al Dykes" <adykespanix.com> wrote in message
    news:dsjoe7$ost$1panix5.panix.com...
    > When I tried to run the script in a window in myphpadmin the
    > lock/unlock verbiage died. Why ?
    The usual practice is to use the mysql CLI to execute mysqldump files.
    Can phpmyadmin process mysqldump files?
    I am not sure; I don't use phpmyadmin.

    Regards,
    Bill K.


    Bill Karwin Guest

  7. #7

    Default Re: Can someone explain this MySQL code fragment

    In article <K4idnSJVmph0cXDeRVn-hAcomcast.com>,
    Jerry Stuckle <jstucklexattglobal.net> wrote:
    >Al Dykes wrote:
    >> In article <dsjgtc0d0oenews3.newsguy.com>,
    >> Bill Karwin <billkarwin.com> wrote:
    >>
    >>>"Stefan Rybacki" <stefan.rybackigmx.net> wrote in message
    >>>news:454h85F4vta3U1individual.net...
    >>>
    >>>>>CREATE TABLE `phplist_listattr_comments` ( `id` int(11) NOT NULL
    >>>>>auto_increment, `name` varchar(255) default NULL, `listorder` int(11)
    >>>>>default '0', PRIMARY KEY (`id`), UNIQUE KEY `name` (`name`))
    >>>>>TYPE=MyISAM;
    >>>>>
    >>>>>---- Dumping data for table `phplist_listattr_comments`--
    >>>>>
    >>>>>/*!40000 ALTER TABLE `phplist_listattr_comments` DISABLE KEYS */;
    >>>>>LOCK TABLES `phplist_listattr_comments` WRITE;
    >>>>>UNLOCK TABLES;
    >>>>>/*!40000 ALTER TABLE `phplist_listattr_comments` ENABLE KEYS */;
    >>>>>
    >>>>
    >>>>In this it seems to do nothing because there is nothing between locking
    >>>>and unlocking.
    >>>
    >>>The code looks like the output of mysqldump, the MySQL backup tool.
    >>>
    >>>If there had been any data in the table when the mysqldump was run, it would
    >>>have generated a bunch of INSERT statements in between the LOCK and the
    >>>UNLOCK.
    >>>
    >>>Regards,
    >>>Bill K.
    >>>
    >>>
    >>
    >>
    >>
    >> Thank you. That was a long script that created similar code for a
    >> bunch of tables and I picked this one at random. Others did have an
    >> insert statement with data.
    >>
    >>
    >> When I tried to run the script in a window in myphpadmin the
    >> lock/unlock verbiage died. Why ?
    >>
    >> Thanks.
    >>
    >>
    >>
    >
    >What version of MySQL are you running?
    4.0.24

    --
    a d y k e s p a n i x . c o m

    Don't blame me. I voted for Gore.
    Al Dykes Guest

  8. #8

    Default Re: Can someone explain this MySQL code fragment

    In article <dsljnk02u3eenews1.newsguy.com>,
    Bill Karwin <billkarwin.com> wrote:
    >"Al Dykes" <adykespanix.com> wrote in message
    >news:dsjoe7$ost$1panix5.panix.com...
    >> When I tried to run the script in a window in myphpadmin the
    >> lock/unlock verbiage died. Why ?
    >
    >The usual practice is to use the mysql CLI to execute mysqldump files.
    >Can phpmyadmin process mysqldump files?
    >I am not sure; I don't use phpmyadmin.
    >
    I'm using a cheap ISP, No shell access. My quest is to take a php
    package that I need and get it to run on a cheap ISP, learning PHP and
    MySQL as I go. I may have aimed too low.

    The SQL script was part of the package. I had the working assumption
    that since there were no users I didn't need to lock/unlock a table to
    load data into it. I edited th script and ran it.

    I hit other showstoppers and have dropped this project so this is no
    longer a must-solve by I learned stuff.

    Thanks.





    --
    a d y k e s p a n i x . c o m

    Don't blame me. I voted for Gore.
    Al Dykes Guest

Similar Threads

  1. HTML code fragment
    By DavidF in forum Web Design
    Replies: 19
    Last Post: July 13th, 03:30 AM
  2. Html Code Fragment Not lining up
    By in forum Web Design
    Replies: 1
    Last Post: June 10th, 05:55 PM
  3. Pasting code into fragment box
    By Ryan in forum Web Design
    Replies: 1
    Last Post: May 13th, 12:05 AM
  4. PASTING HTML CODE FRAGMENT
    By Richard Metzger in forum Web Design
    Replies: 3
    Last Post: January 28th, 02:39 AM
  5. Pub03- No HTML Code Fragment Option
    By Adam in forum Web Design
    Replies: 1
    Last Post: January 18th, 04:15 AM

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139