Need some help

Discussion in 'Programming' started by getatune, Feb 2, 2009.

  1. #1
    I wanna create a script that grabs all the image names from a folder and make's sql's for them.

    SQL:
    So yeah it would replace imgsource with where the image is and then it would go on.
    How would I do this?
     
    getatune, Feb 2, 2009 IP
  2. ez-designs

    ez-designs Well-Known Member

    Messages:
    230
    Likes Received:
    2
    Best Answers:
    0
    Trophy Points:
    105
    As Seller:
    100% - 0
    As Buyer:
    100% - 0
    #2
    Hello, I can create a script that does such for $15.
     
    ez-designs, Feb 2, 2009 IP
  3. atlantaazfinest

    atlantaazfinest Peon

    Messages:
    389
    Likes Received:
    7
    Best Answers:
    0
    Trophy Points:
    0
    As Seller:
    100% - 0
    As Buyer:
    100% - 0
    #3
    sent you a pm
     
    atlantaazfinest, Feb 2, 2009 IP
  4. ActiveFrost

    ActiveFrost Notable Member

    Messages:
    2,072
    Likes Received:
    63
    Best Answers:
    3
    Trophy Points:
    245
    As Seller:
    100% - 0
    As Buyer:
    100% - 0
    #4
    Here you go .. modify it a bit and add your SQL code !

    <?php
    /* Change this path */
    $dir = "images/";
    
    // Open a known directory, and proceed to read its contents
    if (is_dir($dir)) {
        if ($dh = opendir($dir)) {
            while (($file = readdir($dh)) !== false) {
                echo "$file <br>";
                /* Add current image to db */
                mysql_query("INSERT INTO images VALUES ('', '$file')");
            }
            closedir($dh);
        }
    }
    ?>
    PHP:
     
    ActiveFrost, Feb 2, 2009 IP
  5. atlantaazfinest

    atlantaazfinest Peon

    Messages:
    389
    Likes Received:
    7
    Best Answers:
    0
    Trophy Points:
    0
    As Seller:
    100% - 0
    As Buyer:
    100% - 0
    #5
    That was nice of you frost.
     
    atlantaazfinest, Feb 2, 2009 IP
  6. getatune

    getatune Well-Known Member

    Messages:
    1,360
    Likes Received:
    6
    Best Answers:
    0
    Trophy Points:
    125
    As Seller:
    100% - 2
    As Buyer:
    100% - 0
    #6
    thanks :)
    (too short)
     
    getatune, Feb 2, 2009 IP