PHP/MySQL chat?

C++, C#, Java, PHP, ect...
Post Reply
HDWWEClips
Posts: 8
Joined: Sat Apr 24, 2010 7:25 pm

PHP/MySQL chat?

Post by HDWWEClips »

How do I make a PHP/MySQL chat for my site? So I can ban users & have there name they registered with show up in chat?

Tables so far...


DROP TABLE IF EXISTS users;

CREATE TABLE users (
username varchar(30) primary key,
password varchar(32),
userid varchar(32),
userlevel tinyint(1) unsigned not null,
email varchar(50),
timestamp int(11) unsigned not null
);

DROP TABLE IF EXISTS active_users;

CREATE TABLE active_users (
username varchar(30) primary key,
timestamp int(11) unsigned not null
);

DROP TABLE IF EXISTS active_guests;

CREATE TABLE active_guests (
ip varchar(15) primary key,
timestamp int(11) unsigned not null
);

DROP TABLE IF EXISTS banned_users;

CREATE TABLE banned_users (
username varchar(30) primary key,
timestamp int(11) unsigned not null
);
User avatar
Jackolantern
Posts: 10891
Joined: Wed Jul 01, 2009 11:00 pm

Re: PHP/MySQL chat?

Post by Jackolantern »

This is a very complex task, and really more than someone can tell you on the forums. It requires Javascript, PHP and SQL. My suggestion is to find some existing free chat scripts online and implement them into your site. It would be a lot of work, and writing one from scratch would be re-inventing the wheel.

EDIT: Just PHP/MySQL cannot make a real-time chat system. However, there are some non-real time chat system scripts out there that only use PHP. But for modern, real-time chat, you will need JS, PHP and MySQL.
The indelible lord of tl;dr
User avatar
hallsofvallhalla
Site Admin
Posts: 12026
Joined: Wed Apr 22, 2009 11:29 pm

Re: PHP/MySQL chat?

Post by hallsofvallhalla »

yes do use a script already out there. Trust me there are tons of them you can modify them. It is how I made the chat system for QOC.
Post Reply

Return to “Coding”