php - Updating SQL with TextArea - only updates with short strings -
i have textarea in form. form, upon submit, inserts information databse. though "newstext" longtext, able insert short strings. update question exact amount of characters.
the form:
<form id="newsform" action="<?php echo $uploadhandler ?>" enctype="multipart/form-data" method="post"> <div class="managementnewstitle"> title<br /> <input id="inputnewstitle" name="inputnewstitle" type="text"></input> </div> <div class="managementnewstitle"> image<br /> <input id="inputnewsfile" type="file" name="file" onchange="document.getelementbyid('inputnewsfilename').value = value;"><br /> name<br /> <input id="inputnewsfilename" type="text"></input> </div> <div class="managementnewstitle"> text<br /> <textarea id="inputnewstext" name="inputnewstext"></textarea> </div> <input type="hidden" name="givenfilename" id="givenfilename" value=""> <input type="hidden" name="max_file_size" value="<?php echo $max_file_size; ?>"> <input type="hidden" name="newssubmitvalue" id="submitvalue" value="no"> <input type="button" id="newssubmitbutton" onclick="newssubmit()" name="submitbutton" value="save"></input> </form>
the insert:
if($_post['newssubmitvalue'] === "yes") { $newstitle = $_post['inputnewstitle']; $newstext = $_post['inputnewstext']; $newsimageurl = $_post['givenfilename']; mysql_query("insert cs_news values (default, current_timestamp, '".$newstitle."', '".$newstext."', 'images/".$newsimageurl."')"); }
the problem has been solved. not amount of characters, type of characters.
i used quotes in string. made sql statement end prematurely.
woops.
Comments
Post a Comment