Getting Rows From A Session ID

Hi,

I have created a session id but I am struggling to echo an information from database. Does anyone have any suggestions on what I can do.

In all I am trying to update the members profile by using the members id.

Post your code? Hard to tell where you are going wrong when we can’t see what you are working with…

Sorted it, well at least I think I have.

I just couldn’t pull the id from the DB unit I did this:

$id = $_SESSION['userID'];
		
<?php	
	 $id = $_SESSION['userID'];
	


	
function mysql_real_escape_array($t)
{
    return array_map("mysql_real_escape_string",$t);
}

function trim_array($ar)
{
    return array_map("trim",$ar);
}

if(isset($_POST['form_id']))
{
    $_POST = mysql_real_escape_array($_POST);
    $_POST = trim_array($_POST);
    $error = "";

    if(!isset($_POST['category']) || empty($_POST['category'])) {
        $error = "Please select a category.";

    }

    if(!isset($_POST['website']) || empty($_POST['website'])) {
        $error.= " Please enter a Website Domain.";
    }

    if(!isset($_POST['company']) || empty($_POST['company'])) {
        $error.= " Please enter a Company Name.";
    }

    if(!isset($_POST['building']) || empty($_POST['building'])) {
        $error.= " Please enter a Building Name or Number.";
    }

    if(!isset($_POST['streetname']) || empty($_POST['streetname'])) {
        $error.= " Please enter a Street Name.";
    }
	
	    if(!isset($_POST['town']) || empty($_POST['town'])) {
        $error.= " Please enter your Town.";
    }

    if(!isset($_POST['state']) || empty($_POST['state'])) {
        $error.= " Please enter a State.";
    }

    if(!isset($_POST['postcode']) || empty($_POST['postcode'])) {
        $error.= " Please enter a Zip Code/Post Code.";
    }

    if(!isset($_POST['country']) || empty($_POST['country'])) {
        $error.= " Please select your country.";
    }

    if(!isset($_POST['aboutcompany']) || empty($_POST['aboutcompany'])) {
        $error.= " Please enter details about your company.";
    }

    if($error == "")
    {
        $sql = "
        UPDATE
            users
        SET
            category = '".$_POST['category']."',
		linkcategory = '".str_replace(' ', '-',strtolower($_POST['category']))."',
            firstname = '".$_POST['firstname']."',
            surname = '".$_POST['surname']."',
            email = '".$_POST['email']."',
            website = '".$_POST['website']."',
            company = '".$_POST['company']."',
            building = '".$_POST['building']."',
            streetname = '".$_POST['streetname']."',
			town = '".$_POST['town']."',
            state = '".$_POST['state']."',
            postcode = '".$_POST['postcode']."',
            aboutcompany = '".$_POST['aboutcompany']."',
			country = '".$_POST['country']."'
			         WHERE
			id=$id";

        $result = mysql_query($sql) or die("An error occurred ".mysql_error());

    }

}

?>

print_r(); on your array will help you debug