Jump to content
php.lv forumi

Nezinu nosaukumu


airbus

Recommended Posts

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

×
×
  • Create New...