I'm trying to do a single field insert/update from a website to a DB.
It has been working off and on and I am having problems with a 255 char limit (which I thought using TEXT data type would have solved this as well as using the POST method) and I'm also having problems with the text sent.
I've tried addslashes() to take care of the problem but I end up with a whole SLEW of slashes in the file. And now trying an UPDATE on it via the website doesn't work for some reason.
Here is the code I am having a problem with and as far as text goes, you can insert anything>
<?php
$sec_id=$HTTP_POST_VARS['sec_id'];
$loc=$HTTP_POST_VARS['loc'];
$sec=$HTTP_POST_VARS['sec'];
$type=$HTTP_POST_VARS['type'];
$text=$HTTP_POST_VARS['text'];
$new=$HTTP_POST_VARS['new'];
$text=addslashes($text);
include ("../mySQL.php");
$DB = new sql_driver;
$DB->connect();
if(empty($sec_id)){
$DB->query("insert into section values('','".$loc."','".$sec."','".$type."','".$text."');");
}else{
$DB->query("update section set text=\"".$text."\" where sec_id='".$sec_id."';");
}
?>
If anyone can spot whats wrong here I would greatly appreciate a heads up.