Glenskie Posted January 27, 2012 Share Posted January 27, 2012 ok it updates the posts table , but not the notifications table , helP! <?php include("../includes.php"); $session =$logOptions_id; if($session) { $id = $_POST['id']; if(!$id) { $id = $session; } $post = mysql_real_escape_string($_POST['post']); $date = mktime(); $action_type = 0; mysql_query("INSERT INTO posts SET to_id='$id',from_id='$session',post='$post',type='$action_type',date='$date'"); $post_id = mysql_insert_id(); $query = mysql_query("SELECT id,to_id,from_id,post,type,state,date FROM posts WHERE id='$post_id' AND state='0' ORDER BY id DESC LIMIT 15"); print posts($query, "newPost"); if($id!=$session) { mysql_query("INSERT INTO notifications SET user_id='$id', from_id='$session', post_id='$post_id', action_type='$action_type', date='$date'"); } } ?> Link to comment https://forums.phpfreaks.com/topic/255907-not-updating-database/ Share on other sites More sharing options...
AyKay47 Posted January 27, 2012 Share Posted January 27, 2012 then either $id == $session or your query is failing for some reason. If you suspect the ladder, use mysql_query to debug the query. Link to comment https://forums.phpfreaks.com/topic/255907-not-updating-database/#findComment-1311828 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.