Jump to content
php.lv forumi

Lietotāju tabula - UTF-8

Recommended Posts



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?


<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<title>Untitled Document</title>

$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";

// Start looping rows in mysql database.
<table  border="1px" cellspacing="0" cellpadding="3">
<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>
<table  border="1px" cellspacing="0" cellpadding="3">
<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>



Edited by KasparsM
Link to post
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.

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.

  • Create New...