Jump to content
php.lv forumi

mysql select


Vecteevs

Recommended Posts

Sveiki!

Man tāda neliela problēma, nezinu kā parādītu datus manā gadījumā bonusus katram lietotājam savus. Man sanāk parādīt visus punktus. Īsti nezinu kas jādara lai parādītu katram lietotājam savus..

<?php
$host="localhost"; // Host name
$username="root"; // Mysql username
$password="xxxx"; // Mysql password
$db_name="test"; // Database name
$tbl_name="members"; // Table name

// Connect to server and select database.
mysql_connect("$host", "$username", "$password")or die("cannot connect");
mysql_select_db("$db_name")or die("cannot select DB");

$sql="SELECT * FROM $tbl_name";
$result=mysql_query($sql);
?>
<table width="82" border="1" cellspacing="1" cellpadding="0">
<tr>



<?php
while($rows=mysql_fetch_array($result)){
?>
<tr>
<td>Bonusi:</td>

<td width="25" align="center"><? echo $rows['bonus']; ?></td>
</tr>
<?php
}
?>
</table>
</td>
</tr>
</table>
<?php
mysql_close();
?>

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
×
×
  • Create New...