- Notifications
You must be signed in to change notification settings - Fork44
iSimar/Twitter-Like-System-PHP
Folders and files
| Name | Name | Last commit message | Last commit date | |
|---|---|---|---|---|
Repository files navigation
A simple twitter clone using PHP and a MySQL database.
Try out theDemo for Twitter-Like-System-PHP
- Create a new database in MySQL - recommended
- Run the following SQL code to create the tables in the database
CREATE TABLE users( id int NOT NULL AUTO_INCREMENT, username varchar(15) NOT NULL, password varchar(32) NOT NULL, followers int DEFAULT 0, following int DEFAULT 0, tweets int DEFAULT 0, PRIMARY KEY (id));CREATE TABLE following( id int NOT NULL AUTO_INCREMENT, user1_id int REFERENCES `users` (`id`) ON DELETE CASCADE ON UPDATE CASCADE, user2_id int REFERENCES `users` (`id`) ON DELETE CASCADE ON UPDATE CASCADE, PRIMARY KEY (id));CREATE TABLE tweets( id int NOT NULL AUTO_INCREMENT, username varchar(15) NOT NULL, user_id int REFERENCES `users` (`id`) ON DELETE CASCADE ON UPDATE CASCADE, tweet varchar(140) NOT NULL, timestamp bigint(20) NOT NULL, PRIMARY KEY (id));- Open
connect.phpand edit the database information. The following three setting variables are required in order to establish a connection with the database.
$dbuser= "USERNAME"; //Username that is allowed to access the database$dbpass= "PASSWORD"; //Password$dbname= "NAME-OF-THE-DATABASE"; //Name of the databaseAbout
Twitter Clone using PHP
Resources
Uh oh!
There was an error while loading.Please reload this page.
Stars
Watchers
Forks
Releases
No releases published
Packages0
No packages published
