but i cant figure it out for the life of me...how do i echo just like any piece of data from my table in my database like i want to echo one of the fields like some guys last name i already have the information in there i just dont know how to spit it out heres what im trying.... $sql="SELECT * FROM users WHERE firstname='$_POST[firstname]' and pass='$_POST[pass]'"; $result=mysql_query($sql); echo $_POST[lastname]; Code (markup):
Hi there, This is what you need: $sql="SELECT * FROM users WHERE firstname='" . $_POST['firstname'] . "' and pass='" . $_POST['pass'] . "'"; $result=mysql_query($sql); while($row=mysql_fetch_row($result)) { echo $row[0]; // "$row[0]" will show up the first field of your table, "$row[1]" the second field and so on } PHP: Hope that helps P.S.: your code is highly insecure, mate. You need to clean your $_POST variables from any malicious code before using them to prevent a MySQL injection attack. PM me if you need to ask anything, ok?
Hello, Another way is: Browse Information $sql ="Select yourfilename from table"; $result= mysql_query($sql); while ($row = mysql_fetch_assoc($result)) { echo $row['yourfilename']; } Best, Jakomo