Jump to content

Displaying Announcements on any page


Sliffer21

Recommended Posts

I am hoping someone can help me, I want to display my announcements on a php page after seeing the script in the support topics. The script is:

 

<?php

include("support/dbconnect.php");

include("support/includes/functions.php");

$query = "SELECT * FROM tblannouncements WHERE published='on' ORDER BY date DESC LIMIT 0,3";

$result = mysql_query($query);

while ($data = mysql_fetch_array($result)) {

$id = $data["id"];

$date = $data["date"];

$title = $data["title"];

$announcement = $data["announcement"];

$date = fromMySQLDate($date);

echo("<p><font color=#cccccc>$date</font> - <b>$title</b><br>$announcement</p>");

}

?>

 

 

 

but when I edit "support" and change it to whmcs I get an error

Link to comment
Share on other sites

Warning: include(/whmcs/dbconnect.php) [function.include]: failed to open stream: No such file or directory in /home/<cpanelusername>/public_html/staff/index.php on line 120

 

Warning: include() [function.include]: Failed opening '/whmcs/dbconnect.php' for inclusion (include_path='.:/usr/lib/php:/usr/local/lib/php') in /home/<cpanelusername>/public_html/staff/index.php on line 120

 

Warning: include(/whmcs/includes/functions.php) [function.include]: failed to open stream: No such file or directory in /home/<cpanelusername>/public_html/staff/index.php on line 121

 

Warning: include() [function.include]: Failed opening '/whmcs/includes/functions.php' for inclusion (include_path='.:/usr/lib/php:/usr/local/lib/php') in /home/<cpanelusername>/public_html/staff/index.php on line 121

 

Warning: mysql_query() [function.mysql-query]: Access denied for user '<cpanelusername>'@'localhost' (using password: NO) in /home/<cpanelusername>/public_html/staff/index.php on line 123

 

Warning: mysql_query() [function.mysql-query]: A link to the server could not be established in /home/<cpanelusername>/public_html/staff/index.php on line 123

 

Warning: mysql_fetch_array(): supplied argument is not a valid MySQL result resource in /home/<cpanelusername>/public_html/staff/index.php on line 124

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.

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use & Guidelines and understand your posts will initially be pre-moderated