The Lodge is members-only design/dev videos and Office Hours.

Next Office Hours Session: "Implementing an SVG Icon System" Nov 30 - 6:00 PM Eastern

Chat2: Group Chat Room

  • # December 3, 2012 at 11:04 am

    Hello and Greetings,

    My name is Timothy. I am a barely competent web programmer, and learning a lot from this site.

    I want to get the “Chat2: Group Chat Room” going on my website, but I’m having challenges I can’t resolve.

    I uploaded and extracted all the files given in the demo to my website. And when I go to test, I input my username, and then receive a “Could not connect” on the follow-up page.

    What did I not do? What do I need to do?

    Thank you,

    # December 3, 2012 at 11:07 am

    I suppose it could be useful to include a link to the site:

    # December 3, 2012 at 5:42 pm

    This reply has been reported for inappropriate content.

    Have you configured dbcon.php? Do you have a database called chat2_db? I believe you need to use Setup.sql to add the tables to the database.

    # December 3, 2012 at 11:18 pm

    Please forgive me and my incompetence.

    How do I configure dbcon.php? Do I manually create the database chat2_db? And how do I use Setup.sql to add the tables?

    I attempted to create my own database and insert its name into the files, but it failed.

    I swear I am reasonably intelligent, I just don’t know exactly what you’re talking about.

    # December 4, 2012 at 6:05 pm

    This reply has been reported for inappropriate content.

    dbcon.php needs to know how to access your MySQL database. On my laptop, for example, I have apache, php and a mysql setup for localhost connections. My login name is, naturally, “example” and my password is “3x4mpl3_p4ssw0rd”. Someone told me once that it was smart to use letters and numbers, and I have been ever since. The top of dbcon.php therefore looks like:

    define(HOST, ‘localhost’);
    define(USERNAME, ‘example’);
    define(PASSWORD, ‘3x4mpl3_p4ssw0rd’);

    To set up the database, go into MySQL and create the database:

    CREATE DATABASE chat2_db;

    To execute Setup.sql, navigate in the terminal to the directory with Setup.sql in, then execute the following:

    mysql -u example -p chat_db < Setup.sql

    Remember that example is my username, not yours, and you might need to put something else in. You will be prompted for your password.

    Alternatively, I’m sure PHPMyAdmin will have a nice interface for all of this.

Viewing 5 posts - 1 through 5 (of 5 total)

You must be logged in to reply to this topic.

There's a whole bunch of content on CSS-Tricks.

Search for Stuff   •   Browse the Archives

Get the Newsletter ... or get the RSS feed