Jump to content

Database Logs


CJLeah

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
Link to comment
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]
Link to comment
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.
Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

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.   Restore formatting

  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.

×
×
  • Create New...

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.