mike6256 Posted February 23, 2009 Share Posted February 23, 2009 Hi all I am fairly new at php and need a little help. I am having trouble with a code-it will insert my image but will not insert my number. # Gather all required data $name = mysqli_real_escape_string($dbLink, $_FILES['uploaded_file']['name']); $mime = mysqli_real_escape_string($dbLink, $_FILES['uploaded_file']['type']); $size = $_FILES['uploaded_file']['size']; $data = mysqli_real_escape_string($dbLink, file_get_contents($_FILES ['uploaded_file'][ 'tmp_name'])); $number = mysqli_real_escape_string($dbLink, $_POST['textfield'], "text"), The last line keeps kicking a pharse error Thanks For Any Help Link to comment https://forums.phpfreaks.com/topic/146594-solved-inserting-data/ Share on other sites More sharing options...
trq Posted February 23, 2009 Share Posted February 23, 2009 There is no third perameter to mysqli_real_escape_string, what is "text" doing there? Link to comment https://forums.phpfreaks.com/topic/146594-solved-inserting-data/#findComment-769576 Share on other sites More sharing options...
The Little Guy Posted February 23, 2009 Share Posted February 23, 2009 probably because you are using a coma instead of a semi-colon, and you have too many parameters... Try this: $name = mysqli_real_escape_string($dbLink, $_FILES['uploaded_file']['name']); $mime = mysqli_real_escape_string($dbLink, $_FILES['uploaded_file']['type']); $size = $_FILES['uploaded_file']['size']; $data = mysqli_real_escape_string($dbLink, file_get_contents($_FILES['uploaded_file']['tmp_name'])); $number = mysqli_real_escape_string($dbLink, $_POST['textfield'] . "text"); Link to comment https://forums.phpfreaks.com/topic/146594-solved-inserting-data/#findComment-769579 Share on other sites More sharing options...
mike6256 Posted February 23, 2009 Author Share Posted February 23, 2009 updated the code with the ; now is as follows # Gather all required data $name = mysqli_real_escape_string($dbLink, $_FILES['uploaded_file']['name']); $mime = mysqli_real_escape_string($dbLink, $_FILES['uploaded_file']['type']); $size = $_FILES['uploaded_file']['size']; $data = mysqli_real_escape_string($dbLink, file_get_contents($_FILES ['uploaded_file'][ 'tmp_name'])); $number = mysqli_real_escape_string($dbLink, $_POST['textfield'], ("text"); same thing--pharse error Link to comment https://forums.phpfreaks.com/topic/146594-solved-inserting-data/#findComment-769587 Share on other sites More sharing options...
Philip Posted February 23, 2009 Share Posted February 23, 2009 What is , ("text"); supposed to be? Link to comment https://forums.phpfreaks.com/topic/146594-solved-inserting-data/#findComment-769590 Share on other sites More sharing options...
The Little Guy Posted February 23, 2009 Share Posted February 23, 2009 updated the code with the ; now is as follows # Gather all required data $name = mysqli_real_escape_string($dbLink, $_FILES['uploaded_file']['name']); $mime = mysqli_real_escape_string($dbLink, $_FILES['uploaded_file']['type']); $size = $_FILES['uploaded_file']['size']; $data = mysqli_real_escape_string($dbLink, file_get_contents($_FILES ['uploaded_file'][ 'tmp_name'])); $number = mysqli_real_escape_string($dbLink, $_POST['textfield'], ("text"); same thing--pharse error check my previous post, I concatenated some values... with the last line. Link to comment https://forums.phpfreaks.com/topic/146594-solved-inserting-data/#findComment-769592 Share on other sites More sharing options...
mike6256 Posted February 23, 2009 Author Share Posted February 23, 2009 Well got it part working by updating code to: $number = mysqli_real_escape_string($dbLink, $_POST['textfield']["text"]); Now will insrt the first character only ex. D instead of DT-41177 Link to comment https://forums.phpfreaks.com/topic/146594-solved-inserting-data/#findComment-769612 Share on other sites More sharing options...
The Little Guy Posted February 23, 2009 Share Posted February 23, 2009 try this: $number = mysqli_real_escape_string($dbLink, $_POST['textfield']); Link to comment https://forums.phpfreaks.com/topic/146594-solved-inserting-data/#findComment-769614 Share on other sites More sharing options...
mike6256 Posted February 23, 2009 Author Share Posted February 23, 2009 THAT DID IT! Thanks for all the help! Link to comment https://forums.phpfreaks.com/topic/146594-solved-inserting-data/#findComment-769620 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.