No. Functions often require arguments, as yours do. That means that when you call the function, you must supply values to it. In the definition of the function, the expected arguments are listed within the parentheses following the name of the function, on the first line. When you call the function, you must supply values for those arguments within the parentheses of the calling statement. Your get_message() function requires 3 arguments, your get_content() function requires 2 arguments. I am saying that you should require the 3rd argument in get_content(), just like you do in get_message, that 3rd argument being the topic_id. Then, in both functions, you should NOT redefine the argument by referring to the $_POST array, because you already defined it as an argument to the function. Of course, you will need to refer to the $_POST array to get the proper value to use as an argument, before trying to call the function.scarface222 wrote:Thanks for the suggestion. I echoed the mysql statement and received resource id#3 and as for passing a variable through the argument what exactly do you mean. Do you mean writing the post statement within the function brackets?
You were not echoing the SQL statement if it echo'ed "Resource id#3". That could only come as a result of trying to echo the mysql query results, which cannot be printed out except by fetching the rows and echoing individual column values. The SQL statement begins with "SELECT" or "INSERT" or "UPDATE", etc. That's what you want to echo back, so you know exactly what you are asking the database to do, since that's what is failing. I suspect that when you do that, you will find that some values are missing, which then explains why you get no valid results on which mysql_fetch can operate. But you'll never know until you look at the SQL statement to see what it really contains.