Log in

View Full Version : Quick php Help [quick]



Assassinator
29-12-2007, 02:11 PM
Ok this is just abit of the script, this bit is in the middle of the page.

Basicly i want it so when type in a username if fetchs the infomation i want, here is my code.

(Yes i already have db_connect.php etc, as i said this is only a part of the page)




<table width="100%" border="1" cellpadding="0" cellspacing="0" bordercolor="#000000" class="thinline">

<tr background="includes/grad.jpg">

<td height="21" colspan="5" background="skins/<?php echo"$fetch->skin"; ?>/grad.jpg"><div align="center">
View a user's Info</div></td>

</tr>

<tr>

<td width="163" align="center">Money</td>

<td width="162" align="center">Bullets</td>

<td width="148" align="center">Credits</td>

<td width="191" align="center">Rankpoints</td>

<td width="200" align="center">Health</td>

</tr>

<?php

if ($_POST['search24']){

$usernameisa = $_POST['username24'];

}

$kkk=mysql_query("SELECT * FROM `users` WHERE `to`='$usernameisa' OR `from`='$usernameisa' ORDER BY id");

while($ppp=mysql_fetch_object($kkk)){

echo "

<tr>

<td>$ppp->money</td>

<td>$ppp->bullets</td>

<td>$ppp->credits</td>

<td>$ppp->rankpoints</td>

<td>$ppp->health</td>

</tr>";

}

?>

<tr>

<td height="26" colspan="5" align="center">Username:

<input type="text" name="username24" id="username24" />

<input type="submit" name="search24" id="search24" value="Search Username" /></td>

</tr>

</table>

MrCraig
29-12-2007, 04:45 PM
Whats with the $fetch-> :S

Im taking it that it works though :S

Um. You want it so that 'onkeypress' it looks for information in the database without having to refresh the page?

If so, use scriptaculous as you cant do it with plain php...

Want to hide these adverts? Register an account for free!