Jump to content

Archived

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

CJLeah

Database Logs

Recommended Posts

<?php $sql_logs = mysql_query("SELECT * FROM logs ORDER by id DESC LIMIT 0, 25");
$logs_data = mysql_fetch_assoc($sql_logs);
do {
echo($logs_data['userid,username,hostname,time,type,message']);
} while ($logs_data = mysql_fetch_assoc($sql_logs)); ?>

hello the above code, is what i'm trying to use to show all log's in the database, it shows NO log information, just leave's it blank. Please HELP guys, thank you.

Chris Leah

Share this post


Link to post
Share on other sites
Okay this code here is completly wrong:
[code]echo($logs_data['userid,username,hostname,time,type,message']);[/code]
it should be this:
[code]echo $logs_date['userid'] . "<br />\n" . $logs_date['username'] . "<br />\n";
echo $logs_date['hostname'] . "<br />\n" .  $logs_date['time'] . "<br />\n";
echo $logs_date['type'] . "<br />\n" . $logs_date['message'];[/code]

Share this post


Link to post
Share on other sites
FYI, I've edited the title... try to keep the 4-letter words out of the titles... I don't care so much about the content of the thread itself, but we don't need the younger crowd seeing that on the index.

And please be more descriptive with your titles in the future.

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.