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

  • SEARCH
  • Home
  • 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 7788289
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 1, 20262026-06-01T20:57:02+00:00 2026-06-01T20:57:02+00:00

Sorry because I’m pretty bad in PHP Thus I find myself very very stupidly

  • 0

Sorry because I’m pretty bad in PHP

Thus I find myself very very stupidly blocked because I am unable to understand or I have to put my info to my connections in my database file “class_DbConnect.php”

in case the file looks like this:

https://github.com/manifestinteractive/easyapns/blob/master/src/php/classes/class_DbConnect.php …

So I tried to resolve it myself by watching the video of “demo” but it is obsolette. The php file taken from the demo being different, at least different enough to trouble me!

I am sure it is simple : I have 4 informations (host, username, pass and DB name) but i don’t know where to set them in the file … i know it’s in this file but don’t know where.

For the rest, we will see later. I have created the necessary DB, I must also understand how the certificates, how to recover, etc. … but for now, I should like already done with the php part …

I will post the different findings and actions here … I’m pretty sure it will be usefull for others.

  • 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-06-01T20:57:04+00:00Added an answer on June 1, 2026 at 8:57 pm

    you are not to put the information in the file but add them when you declare the class

    Explanation

    The Class Contains

    /**
    * Constructor. Initializes a database connection and selects our database.
    * @param string $host       The host to wchich to connect.
    * @param string $username   The name of the user used to login to the database.
    * @param string $password   The password of the user to login to the database.
    * @param string $database   The name of the database to which to connect.
    */
    function __construct($host, $username, $password, $database)
    {
        $this->DB_HOST     = $host;
        $this->DB_USERNAME = $username;
        $this->DB_PASSWORD = $password;
        $this->DB_DATABASE = $database;
    }
    

    what you need in your PHP code is something like this

    $db = new DbConnect("localhost","username","password","database");
    

    It is a bad practice trying to hard-code values directly in a class what if you need to connect to multiple host or database

    Joe Burnett

    As a beginner you don’t need such classes when MySQL as fantastic `mysqli’ extension which is also object oriented and very fast .

    The usage is similar to what you have not but does not require any additional including any class

    Example

    $db = new mysqli("localhost","username","password","database");
    

    Fore more information and examples see http://www.php.net/manual/en/mysqli.construct.php

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Sorry I am very new to open graph and have been having difficulty to
Sorry for the bad question title. Let's say that I have DateRange class that
I have some code here (Sorry because my code is too long but I
Sorry i don't have any code written because i have never written vba in
Sorry if I didn't show you the code because I have no idea how
Sorry I have had to submit this question again because I have had hardly
I'm a noob, and I'm sorry because the question is really stupid. I have
I'm sorry if my question is silly because I just want to ask what
Sorry if this is a repost but I couldn't quite search for it because
Sorry for question but I can't find answer anywhere on internet. I couldn't find

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.