05. januar 2005 - 11:39Der er
16 kommentarer og 1 løsning
Første 15 tegn af udtræk
Har allerede dette:
$result = mysql_query("SELECT *,CONCAT(LEFT(headline,15),SUBSTRING_INDEX(SUBSTRING(headline,15),' ',1),IF(LENGTH(headline)>15,'...','')) As Cws_news FROM Cws_news ORDER BY id DESC LIMIT 0, 5 ") or die(mysql_error());
Men den henter stadigvæk hele 'headline' Hvad er problemet?
<table width="100%" border="0" cellspacing="0" cellpadding="0"> <? include("inc/mysql.php"); // include the file that connects to the DB!
$result = mysql_query("SELECT * FROM Cws_news ORDER BY id DESC LIMIT 0, 5 ") or die(mysql_error()); // Make a query thats gets everything out of Cws_news
while ($row = mysql_fetch_array($result)) { // Make a while that throws everything out
<table width="100%" border="0" cellspacing="0" cellpadding="0"> <? include("inc/mysql.php"); // include the file that connects to the DB!
$result = mysql_query("SELECT * FROM Cws_news ORDER BY id DESC LIMIT 0, 5 ") or die(mysql_error()); // Make a query thats gets everything out of Cws_news
while ($row = mysql_fetch_array($result)) { // Make a while that throws everything out
Tilladte BB-code-tags: [b]fed[/b] [i]kursiv[/i] [u]understreget[/u] Web- og emailadresser omdannes automatisk til links. Der sættes "nofollow" på alle links.