SitePoint Sponsor

User Tag List

Results 1 to 4 of 4
  1. #1
    ********* Addict WP1's Avatar
    Join Date
    Aug 2000
    Location
    New York , USA
    Posts
    407
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Cool HELP! / Newbie / Trying to get db connect script to work

    Hello,

    I am a newbie. I downloaded and unzipped a file which is a dictionary file for phpNuke.

    The SQL file contains the words and definitions. It is 23.3MB.

    I have not been able to upload this file into phpMyAdmin either by uploading the file via "browse" or attempting to copy and paste the file. (The file will not paste into phpMyAdmin.)

    I became exhausted copying small parts of the file and pasting it into phpMyAdmin. The thing is over 5,000 pages.
    I thought maybe an install from the web site might go a bit smoother.

    I am asking the SitePoint community three things.

    1. What do you feel about an install of the database for this script from a web page?

    2. Is there another way to get such a large file into the MySQL database?

    3. What am I doing wrong in the script below? I keep getting a parse error at line 28.
    "Parse error: parse error in /home/userid/public_html/nuke/install.php on line 28"
    PHP Code:
    <?php

    mysql_connect
    (localhostuseridpassword);
    @
    mysql_select_db(database_name);


    ####################### BEGIN THE INSTALL #######################################

    #
    # Table structure for table `nuke_dictionary`
    #

    mysql_query("CREATE TABLE nuke_dictionary. (
      did int(10) NOT NULL auto_increment,
      dic_word varchar(40) NOT NULL default '',
      dic_def text NOT NULL,
      PRIMARY KEY  (did)
    )"
    );


    #
    # Data load for table `nuke_dictionary`
    #

    mysql_query("INSERT INTO nuke_dictionary VALUES (NULL, 'A', '() The first letter of the English and of many other alphabets. The capital A of the alphabets of Middle and Western Europe, as also the small letter (a), besides the forms in Italic, black letter, etc., are all descended from the old Latin A, which was borrowed from the Greek Alpha, of the same form; and this was made from the first letter (/) of the Phoenician alphabet, the equivalent of the Hebrew Aleph, and itself from the Egyptian origin. The Aleph was a consonant letter, with a guttural breath sound that was not an element of Greek articulation; and the Greeks took it to represent their vowel Alpha with the a sound, the Phoenician alphabet having no vowel symbols.')");
    mysql_query("INSERT INTO nuke_dictionary VALUES (NULL, 'A', '() The name of the sixth tone in the model major scale (that in C), or the first tone of the minor scale, which is named after it the scale in A minor. The second string of the violin is tuned to the A in the treble staff. -- A sharp (A/) is the name of a musical tone intermediate between A and B. -- A flat (A/) is the name of a tone intermediate between A and G.')");
    mysql_query("INSERT INTO nuke_dictionary VALUES (NULL, 'A', '() An adjective, commonly called the indefinite article, and signifying one or any, but less emphatically.')");
    mysql_query("INSERT INTO nuke_dictionary VALUES (NULL, 'A', '() In each; to or for each; as, "twenty leagues a day", "a hundred pounds a year", "a dollar a yard", etc.')");
    mysql_query("INSERT INTO nuke_dictionary VALUES (NULL, 'A', '(prep.) In; on; at; by.')");

    ?>
    When i check the database. No dictionary table has been created.

    Thanks in advance for any and all responses.

    WP1
    Webbing Along!!!

  2. #2
    ********* Genius Mike's Avatar
    Join Date
    Apr 2001
    Location
    Canada
    Posts
    5,458
    Mentioned
    1 Post(s)
    Tagged
    0 Thread(s)
    Well for starters, you're going to have to cancel those double quotes int he INSERT statement like this:

    PHP Code:
    mysql_query("INSERT INTO nuke_dictionary VALUES (NULL, 'A', '() In each; to or for each; as, \"twenty leagues a day\", \"a hundred pounds a year\", \"a dollar a yard\", etc.')"); 
    Mike
    It's not who I am underneath, but what I do that defines me.

  3. #3
    ********* Genius Mike's Avatar
    Join Date
    Apr 2001
    Location
    Canada
    Posts
    5,458
    Mentioned
    1 Post(s)
    Tagged
    0 Thread(s)
    Secondly, take the period out of the table name:

    mysql_query("CREATE TABLE nuke_dictionary (
    Mike
    It's not who I am underneath, but what I do that defines me.

  4. #4
    ********* Addict WP1's Avatar
    Join Date
    Aug 2000
    Location
    New York , USA
    Posts
    407
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Thanks for responding.

    Should it look like this??

    PHP Code:
    mysql_query(INSERT INTO nuke_dictionary VALUES (NULL'A''() In each; to or for each; as, \"twenty leagues a day\", \"a hundred pounds a year\", \"a dollar a yard\", etc.')); 
    What about )) at the end of the line??

    WP1
    Webbing Along!!!


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
  •