Jump to content
php.lv forumi

Recommended Posts

Posted

Nu man vajadzetu no sava mysql db regi table accontss izvadit infu, pedejos 10 ierakstus! vai tas ir iespejams?? Kads butu kods??

Posted

Rekur kods:

<?php
// Connecting, selecting database
$link = mysql_connect('mysql_host', 'mysql_user', 'mysql_password')
  or die('Could not connect: ' . mysql_error());
echo 'Connected successfully';
mysql_select_db('my_database') or die('Could not select database');

// Performing SQL query
$query = 'SELECT * FROM accontss ORDER BY datums DESC LIMIT 10';
$result = mysql_query($query) or die('Query failed: ' . mysql_error());

// Printing results in HTML
echo "<table>\n";
while ($line = mysql_fetch_array($result, MYSQL_ASSOC)) {
  echo "\t<tr>\n";
  foreach ($line as $col_value) {
   echo "\t\t<td>$col_value</td>\n";
  }
  echo "\t</tr>\n";
}
echo "</table>\n";

// Free resultset
mysql_free_result($result);

// Closing connection
mysql_close($link);
?>

Posted (edited)

Amm paskaidrosu visu pareizi situacija ir tada Datu baze reg ir tabula acces tur ir id username pass utt man vajag izvadit no turienes pedejos 10 ieliktos username :\ ka lai so dabujn gatavu kads varetu palidzet??

Busu tiesam pateicigs :)

Edited by tk1
×
×
  • Create New...