|
Web design and Programming Discuss website creation and other programming topics. |
|
Thread Tools | Search this Thread | Display Modes |
#1
|
||
|
file to mysql db
How do i go about putting a file (from a submitted form, actually 2 files) into a database as a LONGBLOB... doesnt seem to be working for me the way im doing it so i have no clue... any help would be appreciated
__________________
- My: Drawings, rants, raves, my cat, designs, and everything else i want to put on the net. Free Teamspeak servers: http://gamersnetwork.us/ |
#2
|
||
|
lol how do u put a file period (from a submitted form) into a database, any one who answers this questions really wins i need to know!
|
#3
|
||
|
answers bebobs first tho ... his thread sry m8 i realized after i had posted in your thread...
|
#4
|
||
|
lol thanks its ok tho... i think if no one answers me im gonna go picking through XMB's code to figure out how they did it lol... then *attempt* to do something similar
__________________
- My: Drawings, rants, raves, my cat, designs, and everything else i want to put on the net. Free Teamspeak servers: http://gamersnetwork.us/ |
#5
|
||
|
in your mysql query direct from $_POST use:,
Code:
mysql_query("INSERT INTO blah VALUES(NULL,LOAD_FILE('$_FILES['file']['tmp_name']'),'$value2')"); Code:
move_uploaded_file(soruce,destination.filename); Code:
chmod(destination.filename,octdec("0777")); Code:
mysql_query("INSERT INTO blah VALUES(NULL,LOAD_FILE('destination.filename'),'$value2')"); Code:
chmod(destination.filename,octdec("0644"));
__________________
04' Dodge SRT-4, Mopar Stage 3, 406whp/436wtq |
#6
|
||
|
ty panther i wuv u
yeah i know only one file per blob, i have 2 blobs... guess i worded that wrong
__________________
- My: Drawings, rants, raves, my cat, designs, and everything else i want to put on the net. Free Teamspeak servers: http://gamersnetwork.us/ |
#7
|
||
|
blah... not workin
Parse error: parse error, expecting `T_STRING' or `T_VARIABLE' or `T_NUM_STRING' in /home/gamnet/www/scripts/mapdb.php on line 160 Query: $sql = "INSERT INTO mapdb_maps VALUES ('$cid', 'null', '$name', '$author', '$description', LOAD_FILE('$_FILES['file']['tmp_name']'), LOAD_FILE('$_FILES['screen']['tmp_name']'), '$added', '0')";
__________________
- My: Drawings, rants, raves, my cat, designs, and everything else i want to put on the net. Free Teamspeak servers: http://gamersnetwork.us/ |
#8
|
|||
|
Quote:
It's becase of the (' and then the 's in the $_FILES['. Type it like this: $loadfile=$_FILES['file']['tmp_name']; LOAD_FILE('$loadfile') or even LOAD_FILE('$_FILES["file"]["tmp_name"]')
__________________
04' Dodge SRT-4, Mopar Stage 3, 406whp/436wtq |
#9
|
||
|
one smart man panther lol ... time to make a file database! lol
|
#10
|
||
|
Couldnt add map to DBCan't get stat of '' (Errcode: 2)
this is the chunk of code $added = date("Y-m-d"); $file = $_FILES['file']['tmp_name']; $screen = $_FILES['screen']['tmp_name']; $sql = "INSERT INTO mapdb_maps VALUES ('$cid', 'null', '$name', '$author', '$description', LOAD_FILE('$file'), LOAD_FILE('$screen'), '$added', '0')"; mysql_query($sql) or die("Couldnt add map to DB".mysql_error());
__________________
- My: Drawings, rants, raves, my cat, designs, and everything else i want to put on the net. Free Teamspeak servers: http://gamersnetwork.us/ |
#11
|
||
|
panther seems on point...our humble leader lol
__________________
=====Retired sig team member===== |
#12
|
||
|
bebop, try moving the file to a specific location on the server using my example #2. And then remove the file after your done. Make sure you include the full path in there.
__________________
04' Dodge SRT-4, Mopar Stage 3, 406whp/436wtq |
#13
|
||
|
will get on it and let you know, thanks for th econtoniued help
__________________
- My: Drawings, rants, raves, my cat, designs, and everything else i want to put on the net. Free Teamspeak servers: http://gamersnetwork.us/ |
#14
|
||
|
lol I thought i had a clue about MySql.
youre a bad mofo panther, and thanks for the scripts on your homesite. really makes hosting sigs very easy. and the shoutbox works great. |
Currently Active Users Viewing This Thread: 1 (0 members and 1 guests) | |
|
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
incorporate php file upload with MySQL form? | pauldridge | Tech Support | 1 | 06-16-2010 08:46 AM |
Importing text file in MySQL | devildog00001 | phphq.Net Forums | 1 | 04-04-2005 08:22 AM |
Importing text file in MySQL | DevilDog#1 | Web design and Programming | 11 | 03-27-2005 10:27 AM |
Need some help with db's | AoS.Tecoma2 | phphq.Net Forums | 9 | 11-01-2004 11:36 AM |
db | staffy bull | Sigs and Graphics | 3 | 09-11-2003 12:33 PM |