Search the Community
Showing results for tags 'please help with interger'.
-
error: incorrect interger value colume user2 row 1. IT FOR REPLYING TO PERSONAL MESSAGES THATS NOT WORKING. <?php if(isset($_SESSION['username'])) { if(isset($_GET['id'])) { $id = intval($_GET['id']); $req1 = mysql_query('select title, user1, user2 from pm where id="'.$id.'" and id2="1"'); $dn1 = mysql_fetch_array($req1); if(mysql_num_rows($req1)==1) { if($dn1['user1']==$_SESSION['userid'] or $dn1['user2']==$_SESSION['userid']) { if($dn1['user1']==$_SESSION['userid']) { mysql_query('update pm set user1read="yes" where id="'.$id.'" and id2="1"'); $user_partic = 2; } else { mysql_query('update pm set user2read="yes" where id="'.$id.'" and id2="1"'); $user_partic = 1; } $req2 = mysql_query('select pm.timestamp, pm.message, users.id as userid, users.username, users.avatar from pm, users where pm.id="'.$id.'" and users.id=pm.user1 order by pm.id2'); if(isset($_POST['message']) and $_POST['message']!='') { $message = $_POST['message']; if(get_magic_quotes_gpc()) { $message = stripslashes($message); } $message = mysql_real_escape_string(nl2br(htmlentities($message, ENT_QUOTES, 'UTF-8'))); if(mysql_query('insert into pm (id, id2, title, user1, user2, message, timestamp, user1read, user2read)values("'.$id.'", "'.(intval(mysql_num_rows($req2))+1).'", "", "'.$_SESSION['userid'].'", "", "'.$message.'", "'.time().'", "", "")') and mysql_query('update pm set user'.$user_partic.'read="yes" where id="'.$id.'" and id2="1"' )) { ?>