Re: upload data to MySql

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



I'm new to file uploads, however I managed to get it working.  Are you
copying the file after its been uploaded?  If not you need to do this as the
temp file is destroyed after the script has finished running so you need to
copy it if you wish to store it.  You also will have to chmod 777 to the
directory you wish to copy the file to.  It may help if we can see the
tutorial to try and find out exactly what you are doing.

I've been working from "Build Your Own Database Driven Website Using PHP &
MySQL" By Kevin Yank and its really helpful it covers file uploads.  I'm
also using "PHP and MySQL Web Development" by Luke Wellling and Laura
Thomson.  This covers file uploads also, infact I found it more helpful for
file uploads.


Hope this helps.

Cheers,

G :)

----- Original Message -----
From: "Seabird" <jacco@vliegt.nl>
To: <php-db@lists.php.net>
Sent: Wednesday, November 13, 2002 8:47 PM
Subject:  upload data to MySql


> Hi everyone,
>
> I don't get my upload to work properly. It's a tutorial of the web, but it
> doesn't function (unless I made a mistake). Please help me...
> I have a form passing on 5 fields (text for testing), name: year, make,
> model, price, picture and submit to PHP_SELF
>
> <?php
> if ($submit) {
>
> $db = mysql_connect("localhost","myname","mypassword");
>
> mysql_select_db("$test",$db);
> //DB Test for testing...
>
> $sql = "INSERT INTO test (year,make,model,price,picture) VALUES
> ('$year,$make,$model,$price,$picture')";
> //I created these columns in the table test
>
>
> echo "year: $year<br>\n";
> echo "make: $make<br>\n";
> echo "model: $model<br>\n";
> echo "price: $price<br>\n";
> echo "picture: $picture<br>\n";
> }
>
> ?>
>
> I know I need globals on for this.
> Thanx for the help,
> Jacco
> --
> http://seabird.jmtech.ca
>
> Attitude is Everything!
> But Remember, Attitudes are Contagious!
> Is Yours worth Catching????
>
>
>
> --
> PHP Database Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>


-- 
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


[Index of Archives]     [PHP Home]     [PHP Users]     [Postgresql Discussion]     [Kernel Newbies]     [Postgresql]     [Yosemite News]

  Powered by Linux