[PHP & MYSQL] Help please
Well today i was trying to make a php script.
Basically, it is trying to grab a muted switch (0 or 1)
I want it so that it grabs the field 'muted' from 'users' then it displays ONLY the users if muted field has a value of 1
Can anybody help me out
PHP Code:
<p>
<h3>Account Mutes</h3>
<h5>Fucked up atm</h5>
<?php
$getMutes = dbquery("SELECT id,username,muted FROM users ORDER BY id = '" . $id . "' LIMIT 10");
$getMutes = dbquery("SELECT muted FROM users ORDER BY id = '" . $id . "'");
if(mysql_num_rows($getMutes) > 0 && ($getMutes['muted']) > 1)
{
echo "<table width='100%' border='1'>
<tr>
<td><strong>ID</strong></td>
<td><strong>Username</strong></td>
<td><strong>Options</strong></td>
</tr>";
while($muted = mysql_fetch_assoc($getMutes))
{
echo "<tr>
<td>" . $muted['id'] . "</td>
<td>" . CleanStringForOutput($muted['username']) . "</td>
<td>[ <a href='bans.php?do=del&id=" . $item['id'] . "'>Revert</a> ]
</tr>";
}
echo "</table><br />";
}
else
{
echo "<i>There are no Mutes at this time</i>";
}
?>
</p>
<br />
When i run the script, it says There are no Mutes at this time
I know that isn't the right coding because i suck at php etc etc
Re: [PHP & MYSQL] Help please
Does '$id' even have a value?
Re: [PHP & MYSQL] Help please
Re: [PHP & MYSQL] Help please
How about the fact that you haven't added a connection to MySQL or whatever database you're connecting to, ie ; databasehost , database name, username , password, ect... you need to make such a file that connects to it then you do that line at the top of all your php files where you connect to mysql for grabbing data <?php include lolwut.php ?> or whatever it is ;P
Re: [PHP & MYSQL] Help please
turns out i was using wrong field :P
fixed now