Hi!
I've made a members.php page that is supposed to show all the entries done by the user, in other words, the title, category and year of a movie. After login in the user clicks on a link (href="members.php") and is redirected to members.php.
My problem is that the table is empty, even though there are a couple of titles in the database. Whats wrong with my code?
I appreciate any help!
I'll add my login.php just in case.
Thanks in advance!

Recommended Answers

All 3 Replies

I only look at your sql query in members.php $query2= "select title, category, year from movie where user=' $name2'"; Is the extra space after the first quote is there on purpose?
Assuming $name2 = 'userName'
you are comparing user attribute in database with ' userName' instead of 'userName'.
also check that $name2 gets the proper value.

I only look at your sql query in members.php $query2= "select title, category, year from movie where user=' $name2'"; Is the extra space after the first quote is there on purpose?
Assuming $name2 = 'userName'
you are comparing user attribute in database with ' userName' instead of 'userName'.
also check that $name2 gets the proper value.

Hi liranoz!
Thanks for your help! Now it works!
It was the extra space in '$name2' that was the problem.

You are welcome :)

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.