This is my code which i edited from my lecturer. I have tried several times but it couldn't relieve the results from the database. Is there anything wrong with the coding? I am able to connect to the database not not able to display the datas.

$query = "select * from newsignup where ".$user." like '%".$pwd."%'";This means..SELECT EVERYTHING FROM newsignup WHERE whatever-user-name-was-put-in-the-form LOOKS LIKE whatever-password-was-put-in-the-form. (But even then, the syntax is all kinds of wrong.)

It should probably look a bit more like..

$query = "SELECT * FROM newsignup WHERE user = '$user' AND pwd = '$pwd'";This means..SELECT EVERYTHING FROM newsignup WHERE the field 'user' is exactly what-ever-username-was-entered AND the pwd field is exactly what-ever-password-was-entered-by-the-user.

This is a correctly formatted SQL query. And it's also the query you SHOULD be using as it is looking for exact matches, and not "any-thing-like". Searching for LIKE in a username/pass combo is a bad idea.