
Hi, I'm sure this is a stupid question but I've been trying to find the solution for days and have had no luck. Hopefully someone out there can help.
So I am attempting to set a variable dynamically like so:
$pid = $GET['p_id'];
This part goes smoothly but my problem arises when I attempt to pass this variable to a function in the following way.
public function InsertUpdate($uid,$update,$uploads,$pid) {
$update=mysql_real_escape_string($update);
$time=time();
$ip=$_SERVER['REMOTE_ADDR'];
$p_id = **$p_id;**
.....
$query = mysql_query("INSERT INTO `messages` (message, uid_fk, poster_id,ip,created,uploads) VALUES ('$update', '$uid',
'$pid', '$ip','$time','$uploads')") or die(mysqlerror());
.... For whatever reason the function does not see the variable unless I set it to a constant like
$p_id = 2;
Any ideas would really be appreciated!
If you are facing any programming issue, such as compilation errors or not able to find the code you are looking for.
Ask your questions, our development team will try to give answers to your questions.