Hi I've been trying to solve this for days so hopefully someone knows the answer.
At the top of my script I dynamically set a variable like so:
$p_id = $_GET['p_id'];
I have then attempted to pass this variable to the following function in three different ways without any luck.
1)
public function Insert_Update($uid,$update,$uploads,**$p_id**)
{
.....
$query = mysql_query("INSERT INTO `messages` (message, uid_fk, poster_id,ip,created,uploads) VALUES ('$update', '$uid',
**'$p_id'**, '$ip','$time','$uploads')") or die(mysql_error());....
Interestingly, this approach works for the variable if I change the order of the arguments to ($p_id,$uid,$update,$uploads)
, however the other three variables become invisible to the function.
2)
public function Insert_Update($uid,$update,$uploads)
{...
// ... global **$p_id**;
$query = mysql_query("INSERT INTO `messages` (message, uid_fk, poster_id,ip,created,uploads) VALUES ('$update', '$uid',
**'$p_id'**, '$ip','$time','$uploads')") or die(mysql_error());....
3)
public function Insert_Update($uid,$update,$uploads)
{
....
// $query = mysql_query("INSERT INTO `messages` (message, uid_fk, poster_id,ip,created,uploads) VALUES ('$update', '$uid',
'".$_REQUEST[**'p_id'**]."', '$ip','$time','$uploads')") or die(mysql_error());...
No matter what approach I try the function never sees the variable. Any ideas? Thanks