advancedfuture Posted December 2, 2007 Share Posted December 2, 2007 I am getting the following error on line 33. "Parse error: parse error, unexpected T_STRING in videoUpload.php on line 33" Is my query string malformed? line 31 $query = "INSERT INTO users (video_url) VALUES($path) line 32 WHERE username = test; line 33 mysql_query($query) or trigger_error("FATAL ERROR: " . mysql_error(), E_USER_ERROR); Quote Link to comment Share on other sites More sharing options...
trq Posted December 2, 2007 Share Posted December 2, 2007 Your missing a spaces afetr (VALUES) and also the closing " on line 32. Note if it is a string your attempting to insert $path will need to be surrounded by single quotes also. Quote Link to comment Share on other sites More sharing options...
advancedfuture Posted December 2, 2007 Author Share Posted December 2, 2007 hmm nope still getting a parse error on line 33 Quote Link to comment Share on other sites More sharing options...
GingerRobot Posted December 2, 2007 Share Posted December 2, 2007 Note if it is a string your attempting to insert $path will need to be surrounded by single quotes also. As will 'test' hmm nope still getting a parse error on line 33 Can you show us the new code please? Quote Link to comment Share on other sites More sharing options...
advancedfuture Posted December 2, 2007 Author Share Posted December 2, 2007 New code as follows $path= "upload/".$new_file_name; //Connect to Database and write the URL into the profile mysql_connect("x.x.x.x"," xxxxxxx ","xxxxxxxxx"); $query = "INSERT INTO users (video_url) VALUES ('$path') WHERE username = 'test';" mysql_query($query) or trigger_error("FATAL ERROR: " . mysql_error(), E_USER_ERROR); mysql_close(); Quote Link to comment Share on other sites More sharing options...
GingerRobot Posted December 2, 2007 Share Posted December 2, 2007 You need to close the string before the semi colon: $query = "INSERT INTO users (video_url) VALUES ('$path') WHERE username = 'test'"; Quote Link to comment Share on other sites More sharing options...
advancedfuture Posted December 2, 2007 Author Share Posted December 2, 2007 lol I feel dumb now Thanks for the help though gentlemen! Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.