...

View Full Version : Select from DB



Dfraz
02-25-2008, 06:57 AM
I don't know how to make it select from the database and then whatever number it is it gets the image. I have


<?php require_once("config.php"); ?>
<?php $result = mysql_query("SELECT * FROM qls3_users WHERE username = '$reputation'")
or die(mysql_error()); ?>

<?php

if ($reputation != 10) {

echo "<img src=\"images/buttons/reputation/prep1.jpg\" alt=\"This user is average.\" width=\"8\" height=\"10\ />";

}
$reputation = $retreive_from_database;
if($reputation > 11) {

echo "<img src=\"images/buttons/reputation/prep1.jpg\" alt=\"This user is average.\" width=\"8\" height=\"10\" />";

}
$reputation = $retreive_from_database;
if($reputation > 12) {

echo "<img src=\"images/buttons/reputation/prep1.jpg\" alt=\"This user is average.\" width=\"8\" height=\"10\" />";
}

$reputation = $retreive_from_database;
if($reputation > 13) {

echo "<img src=\"images/buttons/reputation/+positive rep2.PNG\" alt=\"This user is average.\" width=\"10\" height=\"10\" />";
}

?>

But all that does is keeps that image. If I change the database (In phpmyadmin) in default I will put 13 as in the editor it shows "if ($reputation != 10) { " And keeps that same image EVEN when I put 13 as the default.

So can anyone tell me what to use to make this work properly?

Thanks

Fumigator
02-25-2008, 04:48 PM
You really mean to select WHERE username = $reputation?



EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum