<?php require_once('connections/careergroup.php'); ?>
<?php
if (!function_exists("GetSQLValueString")) {
function GetSQLValueString($theValue, $theType, $theDefinedValue = "", $theNotDefinedValue = "")
{
if (PHP_VERSION < 6) {
$theValue = get_magic_quotes_gpc() ? stripslashes($theValue) : $theValue;
}
$theValue = function_exists("mysql_real_escape_string") ? mysql_real_escape_string($theValue) : mysql_escape_string($theValue);
switch ($theType) {
case "text":
$theValue = ($theValue != "") ? "'" . $theValue . "'" : "NULL";
break;
case "long":
case "int":
$theValue = ($theValue != "") ? intval($theValue) : "NULL";
break;
case "double":
$theValue = ($theValue != "") ? doubleval($theValue) : "NULL";
break;
case "date":
$theValue = ($theValue != "") ? "'" . $theValue . "'" : "NULL";
break;
case "defined":
$theValue = ($theValue != "") ? $theDefinedValue : $theNotDefinedValue;
break;
}
return $theValue;
}
}
mysql_select_db($database_careergroup, $careergroup);
$query_Recordset1 = "SELECT first_name, last_name, email, password, sex FROM members";
$Recordset1 = mysql_query($query_Recordset1, $careergroup) or die(mysql_error());
$row_Recordset1 = mysql_fetch_assoc($Recordset1);
$totalRows_Recordset1 = mysql_num_rows($Recordset1);
?>
<html>
<head>
<title> <?php echo $first_name; ?> <?php echo $lastname; ?>s Profile</title>
</head>
<body>
<?php
// Check for a form submission
if (isset($_GET["text"])){
$text = $_GET['text'];
mysql_connect ("$hostname_careergroup", "$username_careergroup", "$password_careergroup")
or die ("Could not connect to the server");
mysql_select_db("careergroup") or die ("That database could not be found");
$userquery = mysql_query("SELECT * FROM members WHERE email= '$text'") or die ("the query");
if (mysql_num_rows($userquery) != 1) /* I think this line is the problem but how to i fix this */
{
die ("that member could not be found!");
while($row_Recordset1 = mysql_fetch_array ($userquery, MYSQL_ASSOC)){
$row_Recordset1['first_name'];
$row_Recordset1['last_name'];
$row_Recordset1['email'];
$row_Recordset1['password'];
$row_Recordset1['sex'];
$row_Recordset1['email'];
}
if ($text != $row_Recordset1['email']) {
die ("there has been a fatal erroe. please try again. ");
}
if ($activated == 0) {
$active = "The account has not been activated.";
}else{
$active = "The account has been activated.";
}
// See what lever the user is
if ($access == 0) {
$admin = "This user is not an administrator.";
}else {
$admin = "This use is an administrator.";
}
}
?>
<h2><?php echo $row_Recordset1['first_name']; ?> <?php echo $row_Recordset1['last_name']; ?>s Profile</h2><br />
<table>
<tr><td> Firstname:</td><td><?php echo $row_Recordset1['first_name']; ?></td></tr>
<tr><td> Lastname:</td><td><?php echo $row_Recordset1['last_name']; ?></td></tr>
<tr><td> Email:</td><td><?php echo $row_Recordset1['email']; ?></td></tr>
<tr><td> Password:</td><td><?php echo $row_Recordset1['password']; ?></td></tr>
<tr><td> Sex:</td><td><?php echo $row_Recordset1['sex']; ?></td></tr>
<?php
} else die ("you need to specify a username!");
?>
</body>
</html>
<?php
mysql_free_result($Recordset1);
?>
lillorme 0 Light Poster
minitauros 151 Junior Poster Featured Poster
lillorme 0 Light Poster
gabrielcastillo 40 Web Developer
diafol
phaneendrahari 14 Newbie Poster
Be a part of the DaniWeb community
We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.