[UPHPU] PHP Session and Comment Question
Brady Mitchell
bradym at ext.usu.edu
Fri May 5 09:41:07 MDT 2006
> My trouble with the login and session propagation is that all the tutorials
> I`ve seen online, I`ve looked at codemonkey and phpfreaks, seem to be based
> on php that is before PHP4 and uses global variables that are depreciated,
> the $HTTP_XXX_VARS variables. I was hoping someone could point me to a more
> up to date tutorial, using the new globals ($_GET, $_POST) and or cookies.
http://www.sitepoint.com/article/users-php-sessions-mysql/
> As for the comments about the movies and the score, I`m curious if any of
> you would have advice on where to store and how to dynamically allocate the
> comments. I figure that there are two choices, to keep the comments with
> each user, or keep them with each movie. I want the users to be able to see
> every comment placed by every user, and also to be able to see all the
> comments for each movie.
There's no reason the comments can't be assiociated with both the movie and the user. In your comments table, store both the movie id and the user id, that way you can easily sort by either.
> I`m also unsure how to dynamically allocate coloumns to the database for
> each row, and be able to search down the list.
Searching is easier than it sounds.
Comments about a specific movie: SELECT comments FROM movie_comments WHERE movie_id = $movie_id;
Comments from a specific user: SELECT comments FROM movie_comments WHERE user_id = $user_id;
You may want to take a look at http://www.sitepoint.com/article/php-mysql-tutorial - it should be a good start for using PHP and mySQL together.
Bray
More information about the UPHPU
mailing list