"16"
genius. Now how do I get this to work as a session on my page?
help with sessions please
Moderator: General Moderators
Re: help with sessions please
Phew, thank the lord, we have found the problem!!!!! lol. Ok so the problem was with the connection to the database. You weren't selecting the database. This whole time I thought that you were doing this in Connections/recommendingpeople.php as the name sort of implies lmao!
Ok so what you will want to do is;
Ok so what you will want to do is;
Code: Select all
<?php
require_once('Connections/recommendingpeople.php');
session_start();
// I have put this equal to 'french' I assume that this is a valid username in rsusername, if not please change!
$username = "french";
mysql_select_db($database_recommendingpeople, $recommendingpeople);
$query = "SELECT * FROM username WHERE username='$username';";
$result = mysql_query($query, $recommendingpeople) or die(mysql_error());
$row = mysql_fetch_assoc($result);
if (!$result) {
echo "Got nothing";
} else {
$_SESSION['userid'] = $row['userid'];
echo $_SESSION['userid'];
}
?>
Re: help with sessions please
"16"
we're going strong!!!
we're going strong!!!
Re: help with sessions please
lol that's it, you're echoing the session variable. 16 is saved into the session for your use on all other pages!!! 
Re: help with sessions please
Thats awesome. Your great. How can I thank you?
I think I am going to have to recompose my original page with the problem and see how it goes.
I think I am going to have to recompose my original page with the problem and see how it goes.
Re: help with sessions please
Persistence is key, lol.
Re: help with sessions please
This aspect of my page is working ggrrreat now. Thankyou for all you've done for me Nielos. You're the best. I owe you one. May you have the best of luck in your life. cheers.
I think what I need to be more careful of is randomly pressing buttons in dreamweaver without understanding what they do. My php was a mess with what dreamweaver wrote me. I'm learning...
till next time....
I think what I need to be more careful of is randomly pressing buttons in dreamweaver without understanding what they do. My php was a mess with what dreamweaver wrote me. I'm learning...
till next time....