| Author |
Topic |
|
d00b13630
Starting Member
12 Posts |
Posted - 2008-04-26 : 21:41:50
|
| $picid = $_GET['picid'];$commentby = $_REQUEST['commentby'];$commentby = filter_text($commentby);$commentby = mysql_real_escape_string($commentby);$comment = $_REQUEST['comment'];$comment = filter_text($comment);$comment = mysql_real_escape_string($comment);$action = $_REQUEST['action'];if($action == 'post_comment'){$insert_comment = "INSERT INTO comments ( picid, comment, commentdate, commentby) VALUES ('".$picid."', '".$comment."', CURRENT_TIMESTAMP, '".$commentby."')";if (!mysql_query($insert_comment)) { die('Error: ' . mysql_error()); }header("Location: ");}returns-Error: Out of range value adjusted for column 'picid' at row 1picid is of int datatype :/ |
|
|
sodeep
Master Smack Fu Yak Hacker
7174 Posts |
Posted - 2008-04-26 : 21:54:40
|
| Doesn't look like SQL Server. |
 |
|
|
d00b13630
Starting Member
12 Posts |
Posted - 2008-04-26 : 21:56:41
|
| mysql.... |
 |
|
|
d00b13630
Starting Member
12 Posts |
Posted - 2008-04-27 : 00:26:40
|
| if i change the datatype of the column the field is inserted as a blank. this is drivin me nuts |
 |
|
|
visakh16
Very Important crosS Applying yaK Herder
52326 Posts |
Posted - 2008-04-27 : 01:34:36
|
| Whats the data type of pcid? |
 |
|
|
d00b13630
Starting Member
12 Posts |
Posted - 2008-04-27 : 02:20:50
|
| int |
 |
|
|
visakh16
Very Important crosS Applying yaK Herder
52326 Posts |
Posted - 2008-04-27 : 02:39:07
|
| Then i guess its receiving some value which is outside range of integer data type from the varaible. Are you able to trace which value when entered from front end causes this error? May be give a print the entered values from application to see which value on insertion causes the error. |
 |
|
|
slimt_slimt
Aged Yak Warrior
746 Posts |
Posted - 2008-04-27 : 06:27:50
|
| depends on what kind of data are you declaring into picid variable. if someone enters 1.23 this is definitly not integer and there for you are getting out of range error.try to look on php/mysql error list. |
 |
|
|
d00b13630
Starting Member
12 Posts |
Posted - 2008-04-27 : 14:04:03
|
| its just inserting a regular integer. if i try to insert the same number without using a php variable it inserts fine.. as soon as i use the variable that i'm using the $_GET to define... i get that error. |
 |
|
|
visakh16
Very Important crosS Applying yaK Herder
52326 Posts |
Posted - 2008-04-27 : 14:16:24
|
| I dunno about PHP. But i guess it might be because you are getting value as string from $_GET. Try casting it to int using CAST() function before inserting. |
 |
|
|
slimt_slimt
Aged Yak Warrior
746 Posts |
Posted - 2008-04-27 : 14:55:27
|
| usually $_GET is used to pass information from the URL and there are exceed limitation. Try $_POST or $_REQUEST. |
 |
|
|
d00b13630
Starting Member
12 Posts |
Posted - 2008-04-27 : 15:34:52
|
| cant quit figure out how u mean to use CAST()...slimt: post breaks the code and request is too vulnerable :/ |
 |
|
|
d00b13630
Starting Member
12 Posts |
Posted - 2008-04-27 : 15:38:25
|
| and anyways... REQUEST does the same thing.. btw.. i am trying to pass info from url.. the picid that im trying to insert :) |
 |
|
|
|