Hi guys,
i need echo first 2 rows of my table with connect to mysql database and get it to html table.
This code echo all items of my table but i need just 2 rows. Please rewrite my code . Or send to me condition which i can use. THX!
<?php
$host=’xxx’;
$user=’xxx’;
$password=’xxx’;
$database=’xxx’;
// Connects to your Database
mysql_connect($host, $user, $password) or die(mysql_error());
mysql_select_db(“$database”) or die(mysql_error());
mysql_query(‘SET NAMES UTF8’);
mysql_query(‘SET COLLATION_CONNECTION=uft8_slovak_ci’);
$table=’culture’;
$query=’SELECT * FROM ‘.$table;/
$result=mysql_query($query) or die(mysql_error($db));
//tabulka
echo “<table class=’table’>
<tr>
<th>názov</th>
<th>Obrázok</th>
</tr>”;
/*while ($record=mysql_fetch_array($result)
echo “<tr>”;
echo “<td>”.record[‘name’].”</td>”;
echo “<td><img src=”.$record[‘img’].”></td>”;
echo “</tr>”;
};
echo “</table>”;
/* Mysql_close($query);
?>