Sorry for late reply but yesterday daniweb was down so i was unable to reply, anyway the user_id
is placed in login.php
and core.php
so what i have done... I copyed the getUserData
and paste it like getReceiverData
with different session variable in this case receiver_id
so now when im tryng to get the receivers data i get error Notice: Undefined index: receiver_id in C:\xampp\htdocs\Training\core.php on line 46
here is the code for getReceiverData
function getReceiverData($field) {
$DBServer = 'localhost';
$DBUser = 'root';
$DBPass = '';
$DBName = 'upstrey';
$conn = new mysqli($DBServer, $DBUser, $DBPass, $DBName);
if ($conn->connect_error) {
die("Connection failed: " . $conn->connect_error);
}
//$_SESSION['receiver_id'] = 'receiver_id'; <- here need to be ?
$sql = "SELECT `$field` FROM `users` WHERE `ID`='".$_SESSION['receiver_id']."'";
$result = $conn->query($sql);
if ($result->num_rows > 0) {
while($row = $result->fetch_assoc()) {
return $row["$field"];
}
}
$conn->close();
}
So this error gives me hint to store somewhere the session variable like you said in previous post but the problem is i do not know how and where to store, is there any option that you can change the code and store it the session because im really confuzed, Thank you alot for replying here and have a nice day or night, depends.... :D
P.S i almost forgoted, i have a really small error over here for Undefined variable: count
take a look ever here and why is showing me the error btw its working just the error bothering me. Im sorry for asking theese questions in same …