Jump to content

not updating database


Glenskie

Recommended Posts

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

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.