Jump to content

Selecting certain things from a database. Need help...


ricerocket

Recommended Posts

How can I do the following:

 

Theres a contact form which has two parts. the first part is for the public and the second is for members. The public section is fine and works how i need it but I need the member section to automatically get the name and email. The username is stored in a session but the email is stored in the database, how do I get the email from the database into a variable using the username which is in the session??? Help please I'm really lost...

i hope you are aware of mysql function availabel in PHP.....

 

$dbconnect=mysql_connect(username,password,host);

mysql_select_db("database name");

 

...

then use mysql_query() to execute the query and use mysql_fetch_row or mysql_fetch_array() to get the result in the php variables. regarding md5,md5 is one way encryption method. Hence you need to do md5("text value from form"); has to be used in your query

 

something like

select email from user_table where username=$_SESSION['username'] and password=md5($_POST['password']);

 

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.