Help!

    Date: 01/22/06 (PHP Community)    Keywords: database

    I'm having trouble with this script. It's supposed to insert data from
    a form into a database and upload a file. The file is uploading
    properly, but nothing is going into the database. Anyone ever have a
    similar problem? Any idea how I can fix it?








    ini_set ('display_errors', 1);
    error_reporting (E_ALL & ~E_NOTICE);
    if (isset ($_POST['submit'])) {

    if (move_uploaded_file ($_FILES ['photo']['tmp_name'], "portfolio/{$_FILES['photo']['name']}")) {

    print '

    Your file has been uploaded.

    ';
    }
    }

    $url = $_POST["url"];
    $title = $_POST["title"];
    $description = $_POST["description"];
    $category = $_POST["category"];
    $dt = date("Ymd");

    if ($submit) {

    $db = mysql_connect("10.0.11.66", "xxxxx", "xxxxx");
    mysql_select_db("dweia");

    $sql = "INSERT INTO 'photos'
    ('url','title','description','category','date') VALUES
    ('$url','$title','$description','$category','$dt',)";
    $result = mysql_query($sql);
    echo 'Go back';

    } else{
    ?>




    Enter photo name: (ie, filename.jpg)



    Title:


    Choose a category:


    Description:




    }
    ?>


    Source: http://community.livejournal.com/php/399935.html

« Parse error || fixed: function to remove... »


antivirus | apache | asp | blogging | browser | bugtracking | cms | crm | css | database | ebay | ecommerce | google | hosting | html | java | jsp | linux | microsoft | mysql | offshore | offshoring | oscommerce | php | postgresql | programming | rss | security | seo | shopping | software | spam | spyware | sql | technology | templates | tracker | virus | web | xml | yahoo | home