[PHP-DB] Re: FIle Uploading to database
"Todd Williamsen" <[EMAIL PROTECTED]> wrote in message [EMAIL PROTECTED]">news:[EMAIL PROTECTED]... > Well... thanks to Dan Burner for the script... BUT > > I cannot get this friggin INSERT statement to execute.. which craps out.. Specific error messages might help more. Use mysql_error() with die() more to get them. > I cannot figure it out. I have been staring at it for about an hour and I > still cannot figure it out > > here it is: > > $db = @mysql_select_db($db_name, $connection) or die("Could not select > database"); > $query = "INSERT INTO Canidate(FirstName, LastName, Industry, Address1, > Address2, City, State, Zip, LocationPref, Phone, Email, ResumeUp) VALUES > ('$FirstName', '$LastName', '$Industry' '$Address1', 'Address2', '$City', > '$State', '$Zip', '$LocationPref', '$Phone', '$Email', '$ResumeUp2')"; > $result = @mysql_query($query, $connection) or die("could not execute > query"); > $pat = array("#", "@", "*", "&", "%", "@","$","'","`"); > $w= '_'; > $ResumeUp2 = str_replace ($pat, $w, stripslashes($ResumeUp)); > exec("cp '$ResumeUp' '/resumes/$ResumeUp2'"); > ?> > > it errors out on the $result "could not execute query" > > Let me know if you need more info! > > Thank you! > > > "Todd Williamsen" <[EMAIL PROTECTED]> wrote in message > [EMAIL PROTECTED]">news:[EMAIL PROTECTED]... > > I don't want the file to be stored in the database, but its location. > > > > What I want to do: > > > > Upload a file, it gets stored on the webserver, but its location on the > > server is stored in the database. > > > > Where do I look for something like this? > > > > What data type would I use to store the URL or file location? > > > > Thank you > > > > > > -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-DB] Re: File Uploading to database
hi, straying from technical solutions, have you checked for any spelling error? looking at what you pasted in the mailing list, you have: $query = "INSERT INTO Canidate" shouldn't Canidate be Candidate instead? then... VALUES ('$FirstName', '$LastName', '$Industry' '$Address1', 'Address2', '$City', '$State', '$Zip', '$LocationPref', '$Phone', '$Email', '$ResumeUp2')"; does not have a comma between '$Industry' and '$Address1'. well this is with the assumption that you pasted what you are exactly trying to execute. there may be other tiny spelling or punctuation errors. hth, ric [EMAIL PROTECTED] wrote: > > Subject: RE: FIle Uploading to database > Date: Mon, 4 Feb 2002 12:50:44 +1000 > From: "Adam Royle" <[EMAIL PROTECTED]> > To: "Todd Williamsen" <[EMAIL PROTECTED]>, <[EMAIL PROTECTED]> > > You missed the SET parameter in your query... example is below... > > $query = "INSERT INTO Canidate SET (FirstName, LastName, Indus... > > Adam > > -Original Message- > From: Todd Williamsen [mailto:[EMAIL PROTECTED]] > Sent: Monday, February 04, 2002 11:06 AM > To: [EMAIL PROTECTED] > Subject: Re: FIle Uploading to database > > Well... thanks to Dan Burner for the script... BUT > > I cannot get this friggin INSERT statement to execute.. which craps out.. > I cannot figure it out. I have been staring at it for about an hour and I > still cannot figure it out > > here it is: > > $db = @mysql_select_db($db_name, $connection) or die("Could not select > database"); > $query = "INSERT INTO Canidate(FirstName, LastName, Industry, Address1, > Address2, City, State, Zip, LocationPref, Phone, Email, ResumeUp) VALUES > ('$FirstName', '$LastName', '$Industry' '$Address1', 'Address2', '$City', > '$State', '$Zip', '$LocationPref', '$Phone', '$Email', '$ResumeUp2')"; > $result = @mysql_query($query, $connection) or die("could not execute > query"); > $pat = array("#", "@", "*", "&", "%", "@","$","'","`"); > $w= '_'; > $ResumeUp2 = str_replace ($pat, $w, stripslashes($ResumeUp)); > exec("cp '$ResumeUp' '/resumes/$ResumeUp2'"); > ?> > > it errors out on the $result "could not execute query" > > Let me know if you need more info! > > Thank you! > > > > Subject: Re: FIle Uploading to database > Date: Sun, 3 Feb 2002 21:08:41 -0600 > From: "Todd Williamsen" <[EMAIL PROTECTED]> > To: [EMAIL PROTECTED] > > Umm.. > > SET parameter is for the UPDATE query > > "Adam Royle" <[EMAIL PROTECTED]> wrote in message > [EMAIL PROTECTED]">news:[EMAIL PROTECTED]... > > You missed the SET parameter in your query... example is below... > > > > $query = "INSERT INTO Canidate SET (FirstName, LastName, Indus... > > > > Adam > > > > -Original Message- > > From: Todd Williamsen [mailto:[EMAIL PROTECTED]] > > Sent: Monday, February 04, 2002 11:06 AM > > To: [EMAIL PROTECTED] > > Subject: Re: FIle Uploading to database > > > > > > Well... thanks to Dan Burner for the script... BUT > > > > I cannot get this friggin INSERT statement to execute.. which craps out.. > > I cannot figure it out. I have been staring at it for about an hour and I > > still cannot figure it out > > > > here it is: > > > > $db = @mysql_select_db($db_name, $connection) or die("Could not select > > database"); > > $query = "INSERT INTO Canidate(FirstName, LastName, Industry, Address1, > > Address2, City, State, Zip, LocationPref, Phone, Email, ResumeUp) VALUES > > ('$FirstName', '$LastName', '$Industry' '$Address1', 'Address2', '$City', > > '$State', '$Zip', '$LocationPref', '$Phone', '$Email', '$ResumeUp2')"; > > $result = @mysql_query($query, $connection) or die("could not execute > > query"); > > $pat = array("#", "@", "*", "&", "%", "@","$","'","`"); > > $w= '_'; > > $ResumeUp2 = str_replace ($pat, $w, stripslashes($R
Re: [PHP-DB] Re: FIle Uploading to database
GOOD What was the problem!?!? Dan On Monday, February 4, 2002, at 01:44 PM, [EMAIL PROTECTED] wrote: > Ok, > > I got it woohoo!!! > > It works! > > Thanks for all your help > > -Original Message- > From: Dan Brunner [mailto:[EMAIL PROTECTED]] > Sent: Monday, February 04, 2002 10:35 AM > To: [EMAIL PROTECTED] > Subject: Re: [PHP-DB] Re: FIle Uploading to database > > > Does the file come from a Form?? > > Your hosting provider...might be the problem. > > Dan > > > On Monday, February 4, 2002, at 09:57 AM, [EMAIL PROTECTED] wrote: > >> I changed it to its absolute path... It resides with my hosting >> provider... >> >> I removed the >> >> $pat = array("#", "@", "*", "&", "%", "@","$","'","`"); >> $w= '_'; >> $pic_name2 = str_replace ($pat, $w, stripslashes($pic_name)); >> >> To see if the file is being uploaded... >> >> Here is the actual code: >> >> $db = @mysql_select_db("williamsen", $connection) or die("Could not >> select database"); >> $sql ="INSERT INTO Canidate (id, FirstName, LastName, Industry, >> Address1, Address2, City, State, Zip, LocationPref, Phone, Email, >> ResumeUp) >> VALUES >> (\"$id\", \"$FirstName\", \"$LastName\", \"$Industry\", \"$Address1\", >> \"$Address2\", \"$City\", \"$State\", \"$Zip\", \"$LocationPref\", >> \"$Phone\", \"$Email\", \"$userfile\" )"; >> $result = @mysql_query($sql,$connection) or die("OOPS!! Couldn't >> Execute Query!"); >> >> exec("cp '$userfile', 'home/sites/site190/web/resumes/$userfile'"); >> >> The $sql query needed the $connection in there for it to work >> >> -Original Message- >> From: Dan Brunner [mailto:[EMAIL PROTECTED]] >> Sent: Monday, February 04, 2002 9:46 AM >> To: [EMAIL PROTECTED] >> Cc: [EMAIL PROTECTED] >> Subject: Re: [PHP-DB] Re: FIle Uploading to database >> >> >> Make sure the path name is correct >> >> Let's say you compiled apache with this prefix /web >> >> you must have the full path name to work...like this >> >> exec("cp '$ResumeUp' '/web/htdocs/resumes/$ResumeUp2'"); >> >> Also check permissions... >> >> I think that was my problem at first too!!! >> >> >> You can also do debug the script. >> >> Like this >> >> echo $ResumeUp; >> >> That should print the tmp file you form created... >> >> Let me know... >> >> >> Once this pasts...It works really well... >> >> >> Dan >> >> >> >> On Monday, February 4, 2002, at 09:35 AM, [EMAIL PROTECTED] wrote: >> >>> The INSERT statement works fine now, but the file isn't being >> uploaded. >>> I cannot figure out why >>> >>> -Original Message- >>> From: Dan Brunner [mailto:[EMAIL PROTECTED]] >>> Sent: Monday, February 04, 2002 7:54 AM >>> To: [EMAIL PROTECTED] >>> Cc: [EMAIL PROTECTED] >>> Subject: Re: [PHP-DB] Re: FIle Uploading to database >>> >>> >>> Hey did you get it to work yet?!?! >>> >>> >>> Dan >>> >>> >>> On Sunday, February 3, 2002, at 09:08 PM, [EMAIL PROTECTED] wrote: >>> >>>> Umm.. >>>> >>>> SET parameter is for the UPDATE query >>>> >>>> >>>> "Adam Royle" <[EMAIL PROTECTED]> wrote in message >>>> [EMAIL PROTECTED]">news:[EMAIL PROTECTED]... >>>>> You missed the SET parameter in your query... example is below... >>>>> >>>>> $query = "INSERT INTO Canidate SET (FirstName, LastName, Indus... >>>>> >>>>> Adam >>>>> >>>>> -Original Message- >>>>> From: Todd Williamsen [mailto:[EMAIL PROTECTED]] >>>>> Sent: Monday, February 04, 2002 11:06 AM >>>>> To: [EMAIL PROTECTED] >>>>> Subject: Re: FIle Uploading to database >>>>> >>>>> >>>>> Well... thanks to Dan Burner for the script... BUT >>>>> >>>>> I cannot get this friggin INSERT statement to execute.. which > craps >>>>> out.. >>>>> I cannot figure it out. I have been staring at it for about an > hour >>>>> and I >>>>> still cannot figure it out >>>>> >>>>> here it is: >>>>> >>>>> $db = @mysql_select_db($db_name, $connection) or die("Could not >>> select >>>>> database"); >>>>> $query = "INSERT INTO Canidate(FirstName, LastName, Industry, >>> Address1, >>>>> Address2, City, State, Zip, LocationPref, Phone, Email, ResumeUp) >>>>> VALUES >>>>> ('$FirstName', '$LastName', '$Industry' '$Address1', 'Address2', >>>>> '$City', >>>>> '$State', '$Zip', '$LocationPref', '$Phone', '$Email', >>> '$ResumeUp2')"; >>>>> $result = @mysql_query($query, $connection) or die("could not >> execute >>>>> query"); >>>>> $pat = array("#", "@", "*", "&", "%", "@","$","'","`"); >>>>> $w= '_'; >>>>> $ResumeUp2 = str_replace ($pat, $w, stripslashes($ResumeUp)); >>>>> exec("cp '$ResumeUp' '/resumes/$ResumeUp2'"); >>>>> ?> >>>>> >>>>> it errors out on the $result "could not execute query" >>>>> >>>>> Let me know if you need more info! >>>>> >>>>> Thank you! >>>>> >>>>> >>>>> >>>> >>>> >>>> >>>> -- >>>> 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
Re: [PHP-DB] Re: FIle Uploading to database
Make sure the path name is correct Let's say you compiled apache with this prefix /web you must have the full path name to work...like this exec("cp '$ResumeUp' '/web/htdocs/resumes/$ResumeUp2'"); Also check permissions... I think that was my problem at first too!!! You can also do debug the script. Like this echo $ResumeUp; That should print the tmp file you form created... Let me know... Once this pasts...It works really well... Dan On Monday, February 4, 2002, at 09:35 AM, [EMAIL PROTECTED] wrote: > The INSERT statement works fine now, but the file isn't being uploaded. > I cannot figure out why > > -Original Message- > From: Dan Brunner [mailto:[EMAIL PROTECTED]] > Sent: Monday, February 04, 2002 7:54 AM > To: [EMAIL PROTECTED] > Cc: [EMAIL PROTECTED] > Subject: Re: [PHP-DB] Re: FIle Uploading to database > > > Hey did you get it to work yet?!?! > > > Dan > > > On Sunday, February 3, 2002, at 09:08 PM, [EMAIL PROTECTED] wrote: > >> Umm.. >> >> SET parameter is for the UPDATE query >> >> >> "Adam Royle" <[EMAIL PROTECTED]> wrote in message >> [EMAIL PROTECTED]">news:[EMAIL PROTECTED]... >>> You missed the SET parameter in your query... example is below... >>> >>> $query = "INSERT INTO Canidate SET (FirstName, LastName, Indus... >>> >>> Adam >>> >>> -Original Message- >>> From: Todd Williamsen [mailto:[EMAIL PROTECTED]] >>> Sent: Monday, February 04, 2002 11:06 AM >>> To: [EMAIL PROTECTED] >>> Subject: Re: FIle Uploading to database >>> >>> >>> Well... thanks to Dan Burner for the script... BUT >>> >>> I cannot get this friggin INSERT statement to execute.. which craps >>> out.. >>> I cannot figure it out. I have been staring at it for about an hour >>> and I >>> still cannot figure it out >>> >>> here it is: >>> >>> $db = @mysql_select_db($db_name, $connection) or die("Could not > select >>> database"); >>> $query = "INSERT INTO Canidate(FirstName, LastName, Industry, > Address1, >>> Address2, City, State, Zip, LocationPref, Phone, Email, ResumeUp) >>> VALUES >>> ('$FirstName', '$LastName', '$Industry' '$Address1', 'Address2', >>> '$City', >>> '$State', '$Zip', '$LocationPref', '$Phone', '$Email', > '$ResumeUp2')"; >>> $result = @mysql_query($query, $connection) or die("could not execute >>> query"); >>> $pat = array("#", "@", "*", "&", "%", "@","$","'","`"); >>> $w= '_'; >>> $ResumeUp2 = str_replace ($pat, $w, stripslashes($ResumeUp)); >>> exec("cp '$ResumeUp' '/resumes/$ResumeUp2'"); >>> ?> >>> >>> it errors out on the $result "could not execute query" >>> >>> Let me know if you need more info! >>> >>> Thank you! >>> >>> >>> >> >> >> >> -- >> 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
Re: [PHP-DB] Re: FIle Uploading to database
Hey did you get it to work yet?!?! Dan On Sunday, February 3, 2002, at 09:08 PM, [EMAIL PROTECTED] wrote: > Umm.. > > SET parameter is for the UPDATE query > > > "Adam Royle" <[EMAIL PROTECTED]> wrote in message > [EMAIL PROTECTED]">news:[EMAIL PROTECTED]... >> You missed the SET parameter in your query... example is below... >> >> $query = "INSERT INTO Canidate SET (FirstName, LastName, Indus... >> >> Adam >> >> -Original Message- >> From: Todd Williamsen [mailto:[EMAIL PROTECTED]] >> Sent: Monday, February 04, 2002 11:06 AM >> To: [EMAIL PROTECTED] >> Subject: Re: FIle Uploading to database >> >> >> Well... thanks to Dan Burner for the script... BUT >> >> I cannot get this friggin INSERT statement to execute.. which craps >> out.. >> I cannot figure it out. I have been staring at it for about an hour >> and I >> still cannot figure it out >> >> here it is: >> >> $db = @mysql_select_db($db_name, $connection) or die("Could not select >> database"); >> $query = "INSERT INTO Canidate(FirstName, LastName, Industry, Address1, >> Address2, City, State, Zip, LocationPref, Phone, Email, ResumeUp) >> VALUES >> ('$FirstName', '$LastName', '$Industry' '$Address1', 'Address2', >> '$City', >> '$State', '$Zip', '$LocationPref', '$Phone', '$Email', '$ResumeUp2')"; >> $result = @mysql_query($query, $connection) or die("could not execute >> query"); >> $pat = array("#", "@", "*", "&", "%", "@","$","'","`"); >> $w= '_'; >> $ResumeUp2 = str_replace ($pat, $w, stripslashes($ResumeUp)); >> exec("cp '$ResumeUp' '/resumes/$ResumeUp2'"); >> ?> >> >> it errors out on the $result "could not execute query" >> >> Let me know if you need more info! >> >> Thank you! >> >> >> > > > > -- > 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
[PHP-DB] Re: FIle Uploading to database
Umm.. SET parameter is for the UPDATE query "Adam Royle" <[EMAIL PROTECTED]> wrote in message [EMAIL PROTECTED]">news:[EMAIL PROTECTED]... > You missed the SET parameter in your query... example is below... > > $query = "INSERT INTO Canidate SET (FirstName, LastName, Indus... > > Adam > > -Original Message- > From: Todd Williamsen [mailto:[EMAIL PROTECTED]] > Sent: Monday, February 04, 2002 11:06 AM > To: [EMAIL PROTECTED] > Subject: Re: FIle Uploading to database > > > Well... thanks to Dan Burner for the script... BUT > > I cannot get this friggin INSERT statement to execute.. which craps out.. > I cannot figure it out. I have been staring at it for about an hour and I > still cannot figure it out > > here it is: > > $db = @mysql_select_db($db_name, $connection) or die("Could not select > database"); > $query = "INSERT INTO Canidate(FirstName, LastName, Industry, Address1, > Address2, City, State, Zip, LocationPref, Phone, Email, ResumeUp) VALUES > ('$FirstName', '$LastName', '$Industry' '$Address1', 'Address2', '$City', > '$State', '$Zip', '$LocationPref', '$Phone', '$Email', '$ResumeUp2')"; > $result = @mysql_query($query, $connection) or die("could not execute > query"); > $pat = array("#", "@", "*", "&", "%", "@","$","'","`"); > $w= '_'; > $ResumeUp2 = str_replace ($pat, $w, stripslashes($ResumeUp)); > exec("cp '$ResumeUp' '/resumes/$ResumeUp2'"); > ?> > > it errors out on the $result "could not execute query" > > Let me know if you need more info! > > Thank you! > > > -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-DB] RE: FIle Uploading to database
You missed the SET parameter in your query... example is below... $query = "INSERT INTO Canidate SET (FirstName, LastName, Indus... Adam -Original Message- From: Todd Williamsen [mailto:[EMAIL PROTECTED]] Sent: Monday, February 04, 2002 11:06 AM To: [EMAIL PROTECTED] Subject: Re: FIle Uploading to database Well... thanks to Dan Burner for the script... BUT I cannot get this friggin INSERT statement to execute.. which craps out.. I cannot figure it out. I have been staring at it for about an hour and I still cannot figure it out here it is: $db = @mysql_select_db($db_name, $connection) or die("Could not select database"); $query = "INSERT INTO Canidate(FirstName, LastName, Industry, Address1, Address2, City, State, Zip, LocationPref, Phone, Email, ResumeUp) VALUES ('$FirstName', '$LastName', '$Industry' '$Address1', 'Address2', '$City', '$State', '$Zip', '$LocationPref', '$Phone', '$Email', '$ResumeUp2')"; $result = @mysql_query($query, $connection) or die("could not execute query"); $pat = array("#", "@", "*", "&", "%", "@","$","'","`"); $w= '_'; $ResumeUp2 = str_replace ($pat, $w, stripslashes($ResumeUp)); exec("cp '$ResumeUp' '/resumes/$ResumeUp2'"); ?> it errors out on the $result "could not execute query" Let me know if you need more info! Thank you! -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-DB] Re: FIle Uploading to database
Well... thanks to Dan Burner for the script... BUT I cannot get this friggin INSERT statement to execute.. which craps out.. I cannot figure it out. I have been staring at it for about an hour and I still cannot figure it out here it is: $db = @mysql_select_db($db_name, $connection) or die("Could not select database"); $query = "INSERT INTO Canidate(FirstName, LastName, Industry, Address1, Address2, City, State, Zip, LocationPref, Phone, Email, ResumeUp) VALUES ('$FirstName', '$LastName', '$Industry' '$Address1', 'Address2', '$City', '$State', '$Zip', '$LocationPref', '$Phone', '$Email', '$ResumeUp2')"; $result = @mysql_query($query, $connection) or die("could not execute query"); $pat = array("#", "@", "*", "&", "%", "@","$","'","`"); $w= '_'; $ResumeUp2 = str_replace ($pat, $w, stripslashes($ResumeUp)); exec("cp '$ResumeUp' '/resumes/$ResumeUp2'"); ?> it errors out on the $result "could not execute query" Let me know if you need more info! Thank you! "Todd Williamsen" <[EMAIL PROTECTED]> wrote in message [EMAIL PROTECTED]">news:[EMAIL PROTECTED]... > I don't want the file to be stored in the database, but its location. > > What I want to do: > > Upload a file, it gets stored on the webserver, but its location on the > server is stored in the database. > > Where do I look for something like this? > > What data type would I use to store the URL or file location? > > Thank you > > -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php