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...

Link to comment
Share on other sites

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']);

 

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • 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.