Store Form Variables to MYSQL Database

Last post 11-15-2011, 9:57 AM by billledouble. 2 replies.
Sort Posts: Previous Next
  •  11-14-2011, 9:20 AM 71374

    Store Form Variables to MYSQL Database

    Hi,
     
    I'm actually testing the PHP FIle Uploader.
     
    It works fine, I can choose, delete the files and store the Uploaded files into the correct directory according the user id (/uploads/Userid).
     
    Now I would like to store the path and filename of the uploaded files and Post data from my Form ($Title, $Message) into my Database, but I can't figure out how to handle it.
     
    I have read some post, but it stay unclear for me, so I would appreciate if someone could give me an example that I could replicate.
     
    Thanks in advance for your support.
     
    Cheers,
     
    Marc 
     
  •  11-15-2011, 6:18 AM 71386 in reply to 71374

    Re: Store Form Variables to MYSQL Database

    Hi billedouble,
     
    Please refer to example page "form-keepingstate.php", it shows you how to get the upload file info.  Then you can save these info into your database.
     
      foreach($files as $mvcfile)
        {
           
            echo("<tr>");
            echo("<td>");echo("<img src='phpuploader/resources/circle.png' border='0' />");echo("</td>");
            echo("<td>");echo($mvcfile->FileName);echo("</td>");
            echo("<td>");echo($mvcfile->FileSize);echo("</td>");
            echo("</tr>");
        
        }
     
    Regards,
     
    Ken
  •  11-15-2011, 9:57 AM 71390 in reply to 71386

    Re: Store Form Variables to MYSQL Database

    Thank you Ken, I will have a look and try, Cheers
View as RSS news feed in XML