Sveiki,
No PHP gandrīz neko nezinu, pēc pamācības aptuveni uzkabināju tabulu, kurā vajadzētu parādīties visiem lietoājiem, vārdam utt. no datubāzes. Viss strādā labi, izņemot to, ka garumzīmes neparādās. Datubāzē garumzīmes ir, tā kā tur nevajadzētu būt vaina.
Kāds varētu lūdzu uzmest aci kodam?
<!DOCTYPE HTML>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<title>Untitled Document</title>
</head>
<?php
$host="localhost"; // Host name
$username="root"; // Mysql username
$password=""; // Mysql password
$db_name="lost"; // Database name
$tbl_name="jos_users"; // 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");
// Retrieve data from database
$sql="SELECT * FROM $tbl_name";
$result=mysql_query($sql);
// Start looping rows in mysql database.
?>
<table border="1px" cellspacing="0" cellpadding="3">
<tr>
<td width="150px"><strong>Vārds</strong></td>
<td width="150px"><strong>Uzvārds</strong></td>
<td width="150px"><strong>Telefons</strong></td>
<td width="150px"><strong>Uzņēmums</strong></td>
<td width="150px"><strong>E-pasts</strong></td>
</tr>
</table>
<?php
while($rows=mysql_fetch_array($result)){
?>
<table border="1px" cellspacing="0" cellpadding="3">
<tr>
<td width="150px"><?php echo $rows['name'];?></td>
<td width="150px"><?php echo $rows['surname'];?></td>
<td width="150px"><?php echo $rows['username'];?></td>
<td width="150px"><?php echo $rows['company'];?></td>
<td width="150px"><?php echo $rows['email'];?></td>
</tr>
</table>
<?php
}
mysql_close();
?>