Drakethos
Preordered Sc2 ftw!
- Reaction score
- 56
Hello. I am working on a Social Networking site, that has threads and posts. What am trying to do, is get the ID of the post after it has been created and sent to the data base. I tried using SELECT LAST_INSERT_ID but am unable to return a usable value. I keep getting resource#4. After i get the ID i will add it to the current thread, then send the user to that thread. Right now the thread is not created, and I am just trying to produce the posts and generate a link to that post through: post?postid=(autoincrement number)
When i use mysql_fetch_row, i get :
I am pressed for time with this and any help is much appreciated and +rep.
When i use mysql_fetch_row, i get :
Here is some of my code.mysql_fetch_row() expects parameter 1 to be resource, boolean given
Code:
// Creates the post
$result = mysql_query("INSERT INTO `post` VALUES(NULL, '$Title', 'Derrick', '$Post', '$date')");
if (!result) error_message('Could not send post');
// $GetPostId = mysql_query("SELECT LAST_INSER_ID()");
$GetPostId = mysql_query("SELECT LAST_INSERT_ID()FROM `post` LIMIT 0 , 1");
$PostID = mysql_fetch_row($GetPostId);
print($PostId);