airbus Posted July 8, 2009 Report Posted July 8, 2009 ka var saja koda uztaisit ka jaunakais ieraksts iet uz augsu nevis uz leju <?php $con = mysql_connect("localhost","root","parole"); if (!$con) { die('Could not connect: ' . mysql_error()); } mysql_select_db("t", $con); $result = mysql_query("SELECT * FROM persons"); function smailji($teksts) { $ko_aizvietot = array(); $ar_ko_aizvietot = array(); $smailju_array = array( array('/smile.png'," :P"), array('xmas.png','(xmas)'), ); foreach($smailju_array as $smailis) { $ko_aizvietot[] = ' '.$smailis[1].' '; $ar_ko_aizvietot[] = "<img src='/default/{$smailis[0]}' alt='{$smailis[1]}'/>"; } return str_replace($ko_aizvietot,$ar_ko_aizvietot,$teksts); } while($row = mysql_fetch_array($result )) { echo $row['Firstname'] . " - <b> " . $row['Lastname']; echo "</b><br />"; } mysql_close($con); ?>
marcis Posted July 9, 2009 Report Posted July 9, 2009 Precīzāk ORDER BY lauks ASC - augošā secībā ORDER BY lauks DESC - dilstošā secībā
Recommended Posts