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 3672194
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 19, 20262026-05-19T02:34:45+00:00 2026-05-19T02:34:45+00:00

i am using ajax chat from AJAX Chat they have no database to register

  • 0

i am using ajax chat from

AJAX Chat

they have no database to register users and channels, instead they are manually inserted in lib/data/ folder. I want to create my own table for users and channels registration.

Can anyone help me out doing this, caz i cant find anything on internet. Available things are only integration with other forums. But i dont need any forum for this.

Thanks

  • 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-19T02:34:45+00:00Added an answer on May 19, 2026 at 2:34 am

    I downloaded the file and the registered user has the following parameters:

    // Sample registered user:
    $users[3] = array();
    $users[3]['userRole'] = AJAX_CHAT_USER;
    $users[3]['userName'] = 'user';
    $users[3]['password'] = 'user';
    $users[3]['channels'] = array(0,1);
    

    So thats the fields you need to create in your MySQL database:

    CREATE TABLE `DATABSENAME`.`users` (
    `id` INT NOT NULL AUTO_INCREMENT ,
    `userRole` VARCHAR( 50 ) NOT NULL ,
    `userName` VARCHAR( 50 ) NOT NULL ,
    `password` VARCHAR( 50 ) NOT NULL ,
    PRIMARY KEY ( `id` ) ,
    ) 
    

    and

     CREATE TABLE `DATABSENAME`.`channels` (
    `id` INT NOT NULL AUTO_INCREMENT ,
    `channelname` VARCHAR( 50 ) NOT NULL ,
    PRIMARY KEY ( `id` ) ,
    ) 
    

    and

     CREATE TABLE `DATABSENAME`.`users_channels` (
    `id` INT NOT NULL AUTO_INCREMENT ,
    `number` VARCHAR( 50 ) NOT NULL ,
    `userName` VARCHAR( 50 ) NOT NULL ,
    PRIMARY KEY ( `id` ) ,
    ) 
    

    Then you have to load each user into your users.php something like:

    $con = mysql_connect("localhost","username","password");
    if (!$con)
      {
      die('Could not connect: ' . mysql_error());
      }
    
    mysql_select_db("my_db", $con);
    
    $result = mysql_query("SELECT * FROM users");
    
    $j=4
    while($row = mysql_fetch_array($result))
      {
      $users[$j]['userRole']=$row['userRole'];
      $users[$j]['userName']=$row['userName'];
      $users[$j]['password']=$row['password'];
      $j++;
      }
    
    
    for($j=4;$j<(count($users)-4)$j++){
    $result = mysql_query("SELECT * FROM users_channels WHERE userName='".$users[$j]['userName']."'");
    
    $k=0;
    while($row = mysql_fetch_array($result))
      {
         $k++;
         $user[$j]['channels'][$k]=$row['number'];
      } 
    }
    mysql_close($con);
    

    Then you do practically the same for channels.php.
    The second part involves making the database entries when a user registers, not sure how that works and which file that involves but if you know the application you should probably find it.

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

Sidebar

Related Questions

Does anyone know where messages accesses without using database on php-ajax chat? example can
I have made an AJAX chat using Javascript, PHP, and MySQL. I send the
I am creating a chat using Ajax requests and I'm trying to get messages
How do I preview a url using ajax? I have seen this done with
Anyone have any experience creating a modal dialog box using AJAX and ASP.NET MVC?
I have some forms that communicate with server using AJAX for real reasons: cascade
I am trying to create a simple ajax chat using JQuery and ASP.NET. My
I'd like to implement a scalable chatroom in rails using AJAX. I know from
i made a chat using php and ajax, and i am using a while
I finally succeeded in using Ajax to get SOMETHING sent from one page to

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.