0

For some reason the post is not getting inserted into my database.

if($_SESSION['permissions']>=1) {
		$query="INSERT INTO news (id, title, poster, posterid, body) VALUES ('$id','$title','$poster','$posterid','$body')";
		$result=mysql_query($query,$con);
		header("location:index.php");
	}
3
Contributors
3
Replies
4
Views
7 Years
Discussion Span
Last Post by liamfriel
0

Is the '$_SESSION' value set?

Change your query to this:

$result = mysql_query($query,$con)or die("Error: " . mysql_error());

Does it output any errors with that in place?

Edited by Will Gresham: n/a

0

I'll try that. And it appears to be working, it redirects me back to my index. And the $_SESSION is set, otherwise it wouldn't redirect me.

-1

what is wrong with it? does it enter into the database but the values are not there? Otherwise the die() would give you an errror?

This question has already been answered. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.