php - Insert id page on mysql table field -
how insert number(id) of curent page in mysql data base?
i have query:
$page = $_request['id']; addslashes($page); $query = "insert files (file_id,subid,fname,fdesc,tcid,floc) values ($newstd,'$page','" . htmlspecialchars($_request['fname'], ent_quotes) . "','" . htmlspecialchars($_request['fdesc'], ent_quotes) . "','" . $_session['tcid'] . "','" . htmlspecialchars($_request['floc'], ent_quotes) . "')";
page id index.php?id=2
i've tried $page = $_get['page']; addslashes($page); gets page value url, example if went index.php?page=lol return lol $page variable. apply addslashes() $page variable security reasons, going using in mysql query.
but not working.
table configuration:
create table if not exists `files` ( `file_id` int(11) not null, `floc` varchar(500) not null, `fdesc` varchar(100) not null, `tcid` int(11) not null, `subid` text not null, `fname` varchar(100) not null ) engine=myisam auto_increment=41 default charset=latin1;
subid
page number.
use $page = $_request['id'];
instead of $page = $_get['page'];
Comments
Post a Comment