Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7406511
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 29, 20262026-05-29T05:34:11+00:00 2026-05-29T05:34:11+00:00

my calendar script works perfectly fine until I include it into my template. html

  • 0

my calendar script works perfectly fine until I include it into my template. html within events.php is formatted fine but the connection to the database is not processed resulting in the errors you see below. Why is this happening, connection being lost/not processed?

<?php include ROOT . '/files/cal/events.php';?>

Errors:

Warning: mysql_connect() [function.mysql-connect]: Access denied for user ‘nobody’@’localhost’ (using password: NO) in /home/social/public_html/files/cal/smoothcalendar.php on line 19

Warning: mysql_select_db() expects parameter 2 to be resource, boolean given in /home/social/public_html/files/cal/smoothcalendar.php on line 21

Warning: mysql_query() expects parameter 2 to be resource, boolean given in /home/social/public_html/files/cal/smoothcalendar.php on line 195

Could not run query:
Warning: mysql_close() expects parameter 1 to be resource, boolean given in /home/social/public_html/files/cal/smoothcalendar.php on line 38

smoothcalendar.php

<?php
$server   = "localhost";
$username = "****"; 
$password = "****";
$dbname   = "***_socialdb";

class SmoothCalendar {

    private $options = null,
            $get,
            $post;

    private $connection;

    function __construct($options) 
    {
        $this->connection = mysql_connect($GLOBALS["server"  ],
                                          $GLOBALS["username"],
                                          $GLOBALS["password"]);

        mysql_select_db($GLOBALS["dbname"],$this->connection);
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-29T05:34:12+00:00Added an answer on May 29, 2026 at 5:34 am

    You probably have your include inside a function or something else, i.e., not in the global context. That’s why your variables can’t be reached using the $GLOBALS array… they’re not global.

    This should work:

    <?php
    
    class SmoothCalendar {
    
        private $options = null,
                $get,
                $post;
    
        private $connection;
    
        private $server   = "localhost";
        private $username = "****"; 
        private $password = "****";
        private $dbname   = "***_socialdb";
    
        function __construct($options) 
        {
            $this->connection = mysql_connect($this->server,
                                              $this->username,
                                              $this->password);
    
            mysql_select_db($this->dbname, $this->connection);
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

This is the calendar script I got from an online tutorial. It works fine
I have an events calendar written in PHP, with the following pagination script that
I'm using the David Walsh PHP calendar script and need to format my date
Given this markup: // Calendar.html?date=1/2/2003 <script> $(function() { $('.inlinedatepicker').datepicker(); }); </script> ... <div class=inlinedatepicker
Can I export multiple calendar events into a single iCalendar file?
I have an aspx calendar that works fine in IE, however, in FF, the
I've got a calendar extender on one page, and it works fine. Placed in
I am generating events on fullCalendar with this code <script type=text/javascript> $(document).ready(function() { $('#calendar').fullCalendar({
I am using datepicker with php and jQuery to show events however this script
I'm writing a script to highlight table cells across multiple tables, in a calendar.

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.