PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!
and [syntax="..."] tags where appropriate when posting code. Your post has been edited to reflect how we'd like it posted. Please read: [url=http://forums.devnetwork.net/viewtopic.php?t=21171]Posting Code in the Forums[/url] to learn how to do it too.[/color]
I am currently building a website as a project. The web site needs to upload files to a database. I am using blobs to create my code. The code enters all the information about the file eg, name, file type, etc but it does not physically upload the file. The code I have entered is displayed below. I would assistance if anyone could shed a light on what I am doing wrong
and [syntax="..."] tags where appropriate when posting code. Your post has been edited to reflect how we'd like it posted. Please read: [url=http://forums.devnetwork.net/viewtopic.php?t=21171]Posting Code in the Forums[/url] to learn how to do it too.[/color]
Also, is there a particular reason you're wishing to store binary file data in a database as opposed to the file system, where they were intended to be stored? Something to be aware of: the type information found in $_FILES can easily be falsified.
I always put them in file system but if you want to store just few small pictures database is fine.
With more than just a few it is better to store them in the file system.
You have much faster access to them and you don't have to use PHP and MySQL every time you display them.
from the form that I get the information from the user from. That is why I have POST it through, is that incorrect should I use FILE instead? I am fairly new to PHP so I appreciate any advice.
and [syntax="..."] tags where appropriate when posting code. Your post has been edited to reflect how we'd like it posted. Please read: [url=http://forums.devnetwork.net/viewtopic.php?t=21171]Posting Code in the Forums[/url] to learn how to do it too.[/color]
I have changed this section of the PHP to what is shown below and it comes up with a message saying "Couldn't add file to database"
and [syntax="..."] tags where appropriate when posting code. Your post has been edited to reflect how we'd like it posted. Please read: [url=http://forums.devnetwork.net/viewtopic.php?t=21171]Posting Code in the Forums[/url] to learn how to do it too.[/color]