Jump to content
php.lv forumi

Vārdu kļume.


zintis8789

Recommended Posts

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//LV" "http://www.w3.org/TR/html4/loose.dtd">


	<meta http-equiv="content-type" content="text/html; charset=UTF-8" />
              <meta http-equiv="Content-Language" content="lv" />

<b><tr class="sectiontableentry1"><td align="left" height="20">
						<?

 						$db_host = 'localhost';
$db_user = 'userpass';
$db_name = 'db';

$connection = @mysql_connect($db_host, $db_user, $db_password) or die(mysql_error());
mysql_select_db($db_name, $connection);


						$result1 = mysql_query("SELECT * FROM ipb_topics ORDER BY `ipb_topics`.`last_post` DESC LIMIT 0,1 ");
$row1 = mysql_fetch_assoc($result1);

$title = $row1['title'];
$id = $row1['tid'];
$posts = $row1['posts'];
?>

<b><a href="forum//index.php?/topic/<? echo $id; ?>-<? echo $title; ?>/"><? echo $title; ?></a> 
<?
if($title != ''){
echo "[";
echo $posts;
echo "]";
}
?>
</b></td></tr>

Mani ir šāds kods mainu ko gribu ķeburi paliek..

Edited by zintis8789
Link to comment
Share on other sites

Man tas kods ir domāts kā include.

kautko uzmālēju bet burti kā nau tā nau.

 

<b><tr class="sectiontableentry1"><td align="left" height="20">
						<?

 						$db_host = 'localhost';
$db_user = 'xxxx';
$db_password = 'xxx';
$db_name = 'xxx';

$connection = @mysql_connect($db_host, $db_user, $db_password) or die(mysql_error());
mysql_select_db($db_name, $connection);
mysql_set_charset('utf8',$connection); 




						$result1 = mysql_query("SELECT * FROM ipb_topics ORDER BY `ipb_topics`.`last_post` DESC LIMIT 0,1 ");
$row1 = mysql_fetch_assoc($result1);

$title = $row1['title'];
$id = $row1['tid'];
$posts = $row1['posts'];
utf8_encode($title);

?>

<b><a href="forum//index.php?/topic/<? echo $id; ?>-<? echo $title; ?>/"><? echo $title; ?></a> 
<?
if($title != ''){
echo "[";
echo $posts;
echo "]";
}
?>
</b></td></tr>

Edited by zintis8789
Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
×
×
  • Create New...