connectdb.php
<?php
$con=mysqli_connect("mysql3.000webhost.com","a5691033_cc","andrei123","a5691033_cc");
if (mysqli_connect_errno())
{
die("Failed to connect to MySQL: " . mysqli_connect_error());
}
?>
fisierul tau:
<?php
require_once('connectdb.php');
$result = mysqli_query($con,"SELECT * FROM p_capital");
$HTML = "<table>";
while($row = mysqli_fetch_array($result))
{
$HTML .= <<<HTML
<tr>
<td>{$row['suma']}</td>
</tr>
HTML;
}
$HTML .= "</table>";
echo $HTML;
mysqli_close($con);
?>
L-am scris direct in notepad, n-am stat sa vad daca-i bun.