Code + database

3 views
Skip to first unread message

Mohammed Jebrini

unread,
Sep 29, 2010, 7:09:57 PM9/29/10
to <?PHPalClub
Hi guys , How are you doing ??

i guess you are very interested to do some homework's instead of being
on TV in week end .. so let us have some fun here ..

first : for those whom didn't have the db please open any Mysql Admin
and create database with name : blogDb

and user this sql statements to create your tables

-------------------------------

-- phpMyAdmin SQL Dump
-- version 3.2.5
-- http://www.phpmyadmin.net
--
-- Host: localhost
-- Generation Time: Sep 30, 2010 at 02:03 AM
-- Server version: 5.1.44
-- PHP Version: 5.2.13

SET SQL_MODE="NO_AUTO_VALUE_ON_ZERO";

--
-- Database: `blogDB`
--

-- --------------------------------------------------------

--
-- Table structure for table `posts`
--

CREATE TABLE `posts` (
`id` int(11) NOT NULL AUTO_INCREMENT,
`title` varchar(300) NOT NULL,
`body` text NOT NULL,
`published` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP,
`user_id` int(11) NOT NULL,
PRIMARY KEY (`id`),
KEY `user_id` (`user_id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 AUTO_INCREMENT=1 ;

--
-- Dumping data for table `posts`
--


-- --------------------------------------------------------

--
-- Table structure for table `users`
--

CREATE TABLE `users` (
`id` int(11) NOT NULL AUTO_INCREMENT,
`username` varchar(100) NOT NULL,
`password` varchar(32) NOT NULL,
`email` varchar(70) NOT NULL,
PRIMARY KEY (`id`),
UNIQUE KEY `username` (`username`,`email`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 AUTO_INCREMENT=10 ;

--
-- Dumping data for table `users`
--

INSERT INTO `users` VALUES(2, 'admin', 'admin',
'ad...@localhost.com');
INSERT INTO `users` VALUES(3, 'YourName', 'password',
'ma...@mail.com');
INSERT INTO `users` VALUES(5, 'Mohammed', 'newPassword',
'us...@mail.com');
INSERT INTO `users` VALUES(7, 'user2', 'password', 'us...@mail.com');
INSERT INTO `users` VALUES(8, 'user3', 'password', 'us...@mail.com');

--
-- Constraints for dumped tables
--

--
-- Constraints for table `posts`
--
ALTER TABLE `posts`
ADD CONSTRAINT `posts_ibfk_1` FOREIGN KEY (`user_id`) REFERENCES
`users` (`id`);



--------------------------------


After that ,,, you can download the code we worked on today .. from
the like below
----------------------------

http://groups.google.com/group/phpalclub/web/posc_ci.zip

---------------------------  

Please if you have any trouble just send email and let us discuses any
thing you want before the next session


thanks you

naeem khaleel

unread,
Sep 30, 2010, 1:57:36 AM9/30/10
to phpa...@googlegroups.com
thanks Mohammad,
will do it soon.
--
.Net Club
Reply all
Reply to author
Forward
0 new messages