PHP + MYSQL Simple Chat Application (Part 1) - Introduction & Database Connection

preview_player
Показать описание

This is the first video of a tutorial series where I show you how to create a simple Chat Application using:
- PHP
- MYSQL

Software Used:
- Notepad++ - Text Editor
- Google Chrome - Internet Browser
- Xampp - Web Server
Рекомендации по теме
Комментарии
Автор

IndexedWay Hey that's really useful tutorials man! thank u

avinashgardas
Автор

Thanku for these videos. It really helped me.

santoshdevnath
Автор

Saving it into a MySQL database is probably not the way to go.... if you were to put this on any regular webhost and you either get a lot of traffic/spam your website will simply crash because databases aren't made for such ridiculously high traffic, best would be to store the data into a a file like .txt or not save it at all, if you want to actually let the application update live once a message is posted you'll probably use a setInterval to load new content every so often, which is also highly inefficient....

Bottom line, you're using the wrong technique for this sort of application, you would need a Virtual Private Server with Node.js running on it to process the requests, which will also fire a function every time a new message is posted (so you won't need a message checker or interval in your JS) or a free alternative like Pusher will do wonders as well ;D.

You want to make it lightweight in the sense that barely anything should be processed clientside and still make it acceptable for the serverside to process...

PS, I know this was posted in 2012, and this isn't specifically aimed at the uploader, I'm just hoping that if others read this comment they'll know there are better alternatives out there for live enviroments :p

moon_bandage
Автор

the link for the project files doesn't work. Could you send me a new link that works please?

farari
Автор

MySQL queries are being deprecated over the next couple of releases.  You will get warning messages inside your application confirming this. Also XAAMP is harder to configure for newbies. I'd recommend using WAMP if you are on a Windows machine. Easier to configure and you don't have a ton of hoops to jump through.

kjemradio
Автор

I used the same source as you typed in my trials but I keep getting 500 Server Error. I am running Ubuntu and I have checked the permission of the file in /var/www/html directory... all can read and all can write. dont seem to get what is wrong

pipi_delina
Автор

the files you provided in the description where do i put them on my pc 

idgtmodz
Автор

Hey some problem i am getting while doing that project, could you please send me the source code of that project..

krishnakumargupta
Автор

What privileges should the user have when accessing the server?

XIIIX
Автор

The link to project files does not work

coolankit
Автор

is it possible to have those files re up?

nestorsaavedra
Автор

Subsitutes for items (bold is preferred):

Notepad++ : Microsoft Notepad, *Sublime Text*, Komodo IDE.
Xampp : *IIS 10.0*, Wampserver, Wampdeveloper
Google Chrome : *Mozilla Firefox*, Microsoft Edge, Internet Explorer, Opera, Tor-Browser

jay-hbel
Автор

please i will glad if you can show the way out

yahayasuleiman
Автор

where can i create folder include i dont see it in my notepad++ please reply

paulmanila
Автор

this is not easy to start where do I put the root folder I think I got the rest of them but mine wont run

michelleharris
Автор

please am having fatal error in \index.php:on the function  $message = get_message()

yahayasuleiman
Автор

So I couldn't get this working using the method you did. I believe its because I am using the latest versions of php I'm not sure though. I had to use something like this instead.

<?php

//Global db variables
$user = 'root';
$password = 'root';
$db = 'chat';
$host = 'localhost';
$port = '3306';

$link = mysqli_init();
$success = mysqli_real_connect($link, $host, $user, $password, $db, $port);

if ($link) {
echo 'Connected to the server....<br>';

if ($success) {
echo 'Successfully connected to the chat database.. <br>';
} else {
echo 'Failed to find the requested database....<br>';
}

} else {
echo 'Could not connect to the server...<br>';
}
?>


I'm not positive if it functions the same as yours does butt this seemed to be the only way I could get it to work. I haven't tried creating any queries yet however. I found the syntax for this on the MAMP start up page.

jamesblock
Автор

why xampp, does wamp server work the same ?

SVG
Автор

link to the project files please IndexedWay

RavishMahur
Автор

i bet this guy wont even talk to his viewers  thumbs down for that 

idgtmodz