SitePoint Sponsor

User Tag List

Results 1 to 10 of 10
  1. #1
    Making a better wheel silver trophy DR_LaRRY_PEpPeR's Avatar
    Join Date
    Jul 2001
    Location
    Missouri
    Posts
    3,428
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    will everyone run this for me?

    since nobody replied to my thread about accented letters in MySQL i was wondering if you guys would just run this simple script to test it on other MySQL servers for me.

    just copy the code, replace 'username' and 'password' w/ your MySQL username and password, save it, run it, and tell me the results.

    i'd really appreciate it! thanks!

    PHP Code:
    <?php

    $user 
    'username';
    $pass 'password';

    $db 'letters_test';
    mysql_connect('localhost'$user$pass);
    mysql_query("CREATE DATABASE $db") or exit();
    mysql_select_db($db);
    mysql_query("CREATE TEMPORARY TABLE $db (letter CHAR(1))");
    $sql "INSERT INTO $db VALUES('A'),(''),(''),(''),(''),(''),
        ('E'),(''),(''),(''),(''),('I'),(''),(''),(''),(''),
        ('O'),(''),(''),(''),(''),(''),('U'),(''),(''),(''),(''),
        ('a'),(''),(''),(''),(''),(''),('e'),(''),(''),(''),(''),
        ('i'),(''),(''),(''),(''),('o'),(''),(''),(''),(''),(''),
        ('u'),(''),(''),(''),('')"
    ;
    mysql_query($sql);
    $total_rows mysql_affected_rows();
    $r mysql_query("SELECT COUNT(*) FROM $db WHERE letter='a' OR letter='e'
        OR letter='i' OR letter='o' OR letter='u'"
    );
    $r2 mysql_query("SELECT letter FROM $db WHERE letter!='a' AND letter!='e'
        AND letter!='i' AND letter!='o' AND letter!='u'"
    );
    echo 
    'Matched 'mysql_result($r0), " of $total_rows letters.<br />Didn't match: ";

    while (
    $row mysql_fetch_array($r2)) { echo $row['letter']; }

    mysql_query("DROP DATABASE $db");

    ?>
    - Matt ** Ignore old signature for now... **
    Dr.BB - Highly optimized to be 2-3x faster than the "Big 3."
    "Do not enclose numeric values in quotes -- that is very non-standard and will only work on MySQL." - MattR

  2. #2
    SitePoint Addict jamesbond's Avatar
    Join Date
    Feb 2001
    Location
    The Netherlands
    Posts
    256
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Matched
    Warning: Supplied argument is not a valid MySQL result resource in ...../database_test.php on line 23
    of -1 letters.
    Didn't match:
    Warning: Supplied argument is not a valid MySQL result resource in ...../database_test.php on line 25

  3. #3
    SitePoint Addict zoordaan's Avatar
    Join Date
    Feb 2001
    Location
    NYC/Texas
    Posts
    348
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    I ran this on my local setup on my pc, running windows.
    PHP Version 4.0.6 and MySQL 3.23.32

    I made two changes to the script - I didn't create a database, because I already had a test database and I didn't drop a database.

    Results:
    Matched 48 of 54 letters.
    Didn't match:

  4. #4
    SitePoint Addict zoordaan's Avatar
    Join Date
    Feb 2001
    Location
    NYC/Texas
    Posts
    348
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    On my web host running MySQL 3.23.39 and PHP Version 4.0.6

    Results:
    Matched 48 of 54 letters.
    Didn't match:

  5. #5
    Making a better wheel silver trophy DR_LaRRY_PEpPeR's Avatar
    Join Date
    Jul 2001
    Location
    Missouri
    Posts
    3,428
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    jamesbond, something must not be right on your system. did you change the user/pass? are you using at least MySQL 3.23?

    thanks a lot zoordaan! is your host *nix or Windows? those are the same results i got w/ 3.23.41.

    Matched 48 of 54 letters.
    Didn't match:

    i wonder why the a, o, and u with the dots above them don't match but the e and i do. hmmm...

    anyone else wanna run it?

  6. #6
    Dumb PHP codin' cat
    Join Date
    Aug 2000
    Location
    San Diego, CA
    Posts
    5,460
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    /me same

    Code:
    Matched 48 of 54 letters.
    Didn't match: 

    version:
    Code:
    Ver 11.15 Distrib 3.23.40, for Win95/Win98
    Please don't PM me with questions.
    Use the forums, that is what they are here for.

  7. #7
    ********* Callithumpian silver trophy freakysid's Avatar
    Join Date
    Jun 2000
    Location
    Sydney, Australia
    Posts
    3,798
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Matched 48 of 54 letters.
    Didn't match:

    mysql-3.23.41-pc-linux-gnu-i686

    What charset are you trying to use? I know nothing about mysql and international char sets - but I do know that I have a whole heap of interesting stuff in
    /usr/local/mysql/shared/mysql that look like international char sets.
    Last edited by freakysid; Sep 26, 2001 at 13:48.

  8. #8
    Making a better wheel silver trophy DR_LaRRY_PEpPeR's Avatar
    Join Date
    Jul 2001
    Location
    Missouri
    Posts
    3,428
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Originally posted by freakysid
    What charset are you trying to use?
    whatever it is on most installations. b/c on a host i can't the character set (i don't think).


    so it looks like everyone is having the same results. just what i wanted to know.

  9. #9
    SitePoint Addict zoordaan's Avatar
    Join Date
    Feb 2001
    Location
    NYC/Texas
    Posts
    348
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    The web host is running linux, not sure which version.

  10. #10
    Making a better wheel silver trophy DR_LaRRY_PEpPeR's Avatar
    Join Date
    Jul 2001
    Location
    Missouri
    Posts
    3,428
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Originally posted by zoordaan
    The web host is running linux, not sure which version.
    thanks. that's all i wanted to know. now i have a good idea that it works the same way on all (most) versions/platforms.

    thanks to everyone that replied!


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
  •