Jump to content

Archived

This topic is now archived and is closed to further replies.

blade_922

Displaying Code, LIMIT

Recommended Posts

K here is my query

[code]

$hotmain=mysql_query("select * from mos_content ORDER BY `id` DESC LIMIT 2") or die(mysql_error());
while ($donnee = mysql_fetch_array($hotmain))
{ $title= $donnee['title']; 
$introtext=$donnee['introtext'];
$author=$donnee['created_by'];
}
[/code]

For some reason if i just want to display 2 items like i have done i typed 2 and it doesnt display anything, if i change the limit to 9 then it displays 2.

Is there somethin wrong

Share this post


Link to post
Share on other sites
query looks fine do you get any error????

Only thing I can see it that you are not echoing anything out onto the screen

[code]<?php
$hotmain=mysql_query("select * from mos_content ORDER BY `id` DESC LIMIT 2") or die(mysql_error());
while ($donnee = mysql_fetch_array($hotmain))
{
$title= $donnee['title']; 
$introtext=$donnee['introtext'];
$author=$donnee['created_by'];

echo "$title: $introtext $author<br>";
}
?>[/code]

Ray

Share this post


Link to post
Share on other sites

×

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.