A
Anonymous
Guest
Hi guys,
If someone posts a message in my forum, this code will be executed:
$query = "insert into forum values ('', '$subject, '$iconid', '', '')";
$result = mysql_db_query ("vibDB", $query);
$fIndex = mysql_result ($result, 0, "forumIndex");
$query2 = "insert into forumReplies values ('', '$message', '1', '', '1', 'fIndex')";
$result2 = mysql_db_query ("vibDB", $query2);
In the first query, the first parameter(before the subject) is an auto-incremented field, so this gets filled in automatically.
But I want to get this field back to put it into another table where I need it.
The auto-incremented field is named forumIndex, so I based on the result I want to get it by doing this:
- $fIndex = mysql_result ($result, 0, "forumIndex");
But it gives an error if I do this.
But how can I get the auto-incremented value from this post back ?
If someone posts a message in my forum, this code will be executed:
$query = "insert into forum values ('', '$subject, '$iconid', '', '')";
$result = mysql_db_query ("vibDB", $query);
$fIndex = mysql_result ($result, 0, "forumIndex");
$query2 = "insert into forumReplies values ('', '$message', '1', '', '1', 'fIndex')";
$result2 = mysql_db_query ("vibDB", $query2);
In the first query, the first parameter(before the subject) is an auto-incremented field, so this gets filled in automatically.
But I want to get this field back to put it into another table where I need it.
The auto-incremented field is named forumIndex, so I based on the result I want to get it by doing this:
- $fIndex = mysql_result ($result, 0, "forumIndex");
But it gives an error if I do this.
But how can I get the auto-incremented value from this post back ?