Hi i am trying to run a select statement that display the results in a table on my page but its not going. Can someone plz tell me why its not going
==============================================this is the error that i get :
".$row['username']." ".$row['password']." ".$row['email']." ".$row['compname']." ".$row['actype']." ".$row['accountnr']." ".$row['moneytype']." ".$row['value']." Edit | Delete "; } if($action == "delete") { echo "Are you sure you want to delete this user?
Yes
No
"; exit; } else if($delete == "final" && isset($userid)) { $sql = "DELETE FROM users WHERE userid = '$userid'"; $result = @mysql_query($sql) or die(mysql_error()); echo "
User successfully deleted
"; exit; } ?>
To go Back to Admininstration Page click here.
Username Email Address: Companyname accountname accountnumber moneytype ( EUR,USD,POUND) accountvalue ";
}
else if($submit && $action == "edit" && isset($userid))
{ if(!$submit && $action == "edit" && isset($compname) && !empty($password)or !empty($actype) or !empty($value)or !empty($username) or !empty($accountnr) or !empty($moneytype) or !empty($email))
{ $sql = "UPDATE users SET compname='$compname', actype='$actype', username='$username', value='$value',accountnr='$accountnr', moneytype='$moneytype',email='$email',PASSWORD = '$password' WHERE userid = '$userid'"; $result = @mysql_query($sql) or die(mysql_error()); }
} ?>
To go Back to Admininstration Page click here.
=================================
AND THIS IS THE CODE BEHIND:
$connect = mysql_connect("$user_hostname", "$user_username", "$user_password");
mysql_select_db("$user_database", $connect);
$PHP_SELF = str_replace(stristr($PHP_SELF, '?'),'',$PHP_SELF);
echo "<center><table border=1><tr>
<td align=center><b>Userid</b></td>
<td align=center><b>Username</b></td>
<td align=center><b>Password</b></td>
<td align=center><b>email</b></td>
<td align=center><b>compname</b></td>
<td align=center><b>actype</b></td>
<td align=center><b>accountnr</b></td>
<td align=center><b>moneytype</b></td>
<td align=center><b>value</b></td>
<td align=center><b>Option</b></td>
</tr></center>";
$sql = " SELECT userid , username , PASSWORD , email , compname , accountnr , moneytype , actype , value FROM users ORDER BY username ";
$result = @mysql_query($sql) or die(mysql_error());
while($row = mysql_fetch_array($result))
{
echo "<tr>
<td>".$row['userid']."</td>
<td>".$row['username']."</td>
<td>".$row['password']."</td>
<td>".$row['email']."</td>
<td>".$row['compname']."</td>
<td>".$row['actype']."</td>
<td>".$row['accountnr']."</td>
<td>".$row['moneytype']."</td>
<td>".$row['value']."</td>
<td>
<a href=$PHP_SELF?action=edit&userid="$row['userid']">Edit</a> |
<a href=$PHP_SELF?action=delete&userid="$row['userid']">Delete</a></td></tr> ";
}
if($action == "delete")
{
echo "<b>Are you sure you want to delete this user?<p>
<a href=$PHP_SELF?delete=final&userid=$userid>Yes</a><p>
<a href=$PHP_SELF>No</a><p>";
exit;
}
else if($delete == "final" && isset($userid)) {
$sql = "DELETE FROM users WHERE userid = '$userid'";
$result = @mysql_query($sql) or die(mysql_error());
echo "<center>User successfully deleted</center>";
exit;
}
?>
<h3>To go Back to Admininstration Page <a href="friendy456one.php"> click here.</a></h3>
==============================================this is the error that i get :
".$row['username']." ".$row['password']." ".$row['email']." ".$row['compname']." ".$row['actype']." ".$row['accountnr']." ".$row['moneytype']." ".$row['value']." Edit | Delete "; } if($action == "delete") { echo "Are you sure you want to delete this user?
Yes
No
"; exit; } else if($delete == "final" && isset($userid)) { $sql = "DELETE FROM users WHERE userid = '$userid'"; $result = @mysql_query($sql) or die(mysql_error()); echo "
User successfully deleted
"; exit; } ?>
To go Back to Admininstration Page click here.
Username Email Address: Companyname accountname accountnumber moneytype ( EUR,USD,POUND) accountvalue ";
}
else if($submit && $action == "edit" && isset($userid))
{ if(!$submit && $action == "edit" && isset($compname) && !empty($password)or !empty($actype) or !empty($value)or !empty($username) or !empty($accountnr) or !empty($moneytype) or !empty($email))
{ $sql = "UPDATE users SET compname='$compname', actype='$actype', username='$username', value='$value',accountnr='$accountnr', moneytype='$moneytype',email='$email',PASSWORD = '$password' WHERE userid = '$userid'"; $result = @mysql_query($sql) or die(mysql_error()); }
} ?>
To go Back to Admininstration Page click here.
=================================
AND THIS IS THE CODE BEHIND:
$connect = mysql_connect("$user_hostname", "$user_username", "$user_password");
mysql_select_db("$user_database", $connect);
$PHP_SELF = str_replace(stristr($PHP_SELF, '?'),'',$PHP_SELF);
echo "<center><table border=1><tr>
<td align=center><b>Userid</b></td>
<td align=center><b>Username</b></td>
<td align=center><b>Password</b></td>
<td align=center><b>email</b></td>
<td align=center><b>compname</b></td>
<td align=center><b>actype</b></td>
<td align=center><b>accountnr</b></td>
<td align=center><b>moneytype</b></td>
<td align=center><b>value</b></td>
<td align=center><b>Option</b></td>
</tr></center>";
$sql = " SELECT userid , username , PASSWORD , email , compname , accountnr , moneytype , actype , value FROM users ORDER BY username ";
$result = @mysql_query($sql) or die(mysql_error());
while($row = mysql_fetch_array($result))
{
echo "<tr>
<td>".$row['userid']."</td>
<td>".$row['username']."</td>
<td>".$row['password']."</td>
<td>".$row['email']."</td>
<td>".$row['compname']."</td>
<td>".$row['actype']."</td>
<td>".$row['accountnr']."</td>
<td>".$row['moneytype']."</td>
<td>".$row['value']."</td>
<td>
<a href=$PHP_SELF?action=edit&userid="$row['userid']">Edit</a> |
<a href=$PHP_SELF?action=delete&userid="$row['userid']">Delete</a></td></tr> ";
}
if($action == "delete")
{
echo "<b>Are you sure you want to delete this user?<p>
<a href=$PHP_SELF?delete=final&userid=$userid>Yes</a><p>
<a href=$PHP_SELF>No</a><p>";
exit;
}
else if($delete == "final" && isset($userid)) {
$sql = "DELETE FROM users WHERE userid = '$userid'";
$result = @mysql_query($sql) or die(mysql_error());
echo "<center>User successfully deleted</center>";
exit;
}
?>
<h3>To go Back to Admininstration Page <a href="friendy456one.php"> click here.</a></h3>