airbus Posted July 8, 2009 Report Share 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); ?> Link to comment Share on other sites More sharing options...
Kaklz Posted July 8, 2009 Report Share Posted July 8, 2009 pameklē par mysql "order by" Link to comment Share on other sites More sharing options...
Kemito Posted July 8, 2009 Report Share Posted July 8, 2009 Kad SELEKTO izmanto arī ORDER BY ORDER BY kkas Link to comment Share on other sites More sharing options...
marcis Posted July 9, 2009 Report Share Posted July 9, 2009 Precīzāk ORDER BY lauks ASC - augošā secībā ORDER BY lauks DESC - dilstošā secībā Link to comment Share on other sites More sharing options...
Recommended Posts