Jump to content
php.lv forumi

Izvade


tk1

Recommended Posts

Nu tā! man ir kods kas izvada no mysql piemeram 30 pirmos ierakstuts man vajadzētu tā lai apakšā pēc tiem 30 uztaisitu linku un vinjs butu uz nakošajiem 30 bet man neaiziet ka to dabūt gatavu!

kods

<?php
// Connecting, selecting database
$link = mysql_connect('localhost', 'root', 'parole')
  or die('Could not connect: ' . mysql_error());
echo '30 Jaunakas PS pamacibas  :';
mysql_select_db('pm') or die('Could not select database');

// Performing SQL query
$query = 'SELECT `pamaciba` FROM `pamacibam` LIMIT 0, 30';
$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);
?>

Link to comment
Share on other sites

×
×
  • Create New...