
正文
简单的php加数据库网站 如何用php创建数据库
提示:扫一扫查出行【扫一扫了解最新限行尾号】
复制提示
做个PHP的小型电影网站,如何设计数据库?
可以参看discuz数据库表帖子,和帖子附件的设计,我的大概思路是这样的:
首先建立一个数据表"film"用来保存简短文字信息,其中包含:电影发布时有名字,主演,简介,归属栏目,发布电影的URL链接。在创建一个表(考虑到是小型网站,如果中型的话,可以选择10个,像discuz一样)"attachement",用来保存,上传截图,上传视频。这个表用一个外键与film表连接。中间在外键上加索引。
希望我的回答对你有帮助!
相关问答
Q1: 如何做一个简单PHP网站
1.首先你要做什么类型的网站
2.你想要什么功能
3把你想要的功能写下来
4先把数据库建立起来,根据功能创建表
5.通过软件把你的网站的前台的页面设计出来
6.然后写处理页面请求的方法function
7.最简单的就是登陆和注册了.
Q2: 怎么用php写一个简单的登陆页面,要连上数据库
数据库是SQLserver
?
if(isset($_GET['username']))
{
session_start();
$errormsg = "";
$input['username'] = strtolower(trim($_GET['username']));
if($errormsg == "")
{
include("db_link.php");//你自己SQL数据库所在路径
$sql = "select
user_id,
username,
status
from guestbook
where username = '".$input['username']."' and status = 1";
$result = mysql_query($sql, $link) or die('Query database failed');
$num = mysql_num_rows($result);
if($num 1)
{
$errormsg = "用户名不正确,请重新登录!";
}
else
{
$row = mysql_fetch_array($result);
if($row['username'] == $input['username'])
{
$_SESSION['s_user_id'] = $row['user_id'];
$_SESSION['s_username'] = $row['username'];
$_SESSION['s_status'] = $row['status'];
$_SESSION['time_last_load'] = time();
?
!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
html
head
title管理员登录/title
style
button,input{font-size:12px;padding-top:2px;font-family : Arial, Helvetica, sans-serif;}
a:link:{color:#666666;}
a:visited:{color:#666666;}
a:hover:{color:#000000}
/style
/head
body style="font-size: 12px;"
table width="280" border="0" cellspacing="0" cellpadding="0" align="center" style="font-size: 12px;border:1px solid #639ECE;"
trtd height="10"/td/tr
trtd height="40" align="center"登录成功!/td/tr
trtd height="10"/td/tr
trtd height="22" align="right" bgcolor="#EFFBFF"a href="javascript:void(null);" onclick="window.close();"关闭窗口/a /td/tr
/table
/body
/html
?
}
else
{
$errormsg = "用户名不正确,请重新登录!";
}
}
}
if($errormsg "")
{
?
!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
html
head
title管理员登录/title
style
button,input{font-size:12px;padding-top:2px;}
/style
/head
body style="font-size: 12px;"
table width="280" border="0" cellspacing="0" cellpadding="5" align="center" style="font-size: 12px;border:1px solid #639ECE;"
trtd height="10" colspan="2"/td/tr
form action="userlogin.php"
tr
td width="60" align="right"用户名:/td
td width="220"input type="text" name="username" value="?=$input['username']?"/td
/tr
tr
td/td
td align="center" input type="submit" value=" 登录 "/td
/tr
/form
tr
td height="10" colspan="2"/td
/tr
tr
td height="22" colspan="2" bgcolor="#EFFBFF"?=$errormsg?/td
/tr
/table
/body
/html
?
}
}
else
{
?
!--登录页面--
!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
html
head
title管理员登录/title
style
button,input{
font-size:12px;
padding-top:2px;
}
/style
/head
body
table width="280" border="0" cellspacing="0" cellpadding="5" align="center" style="font-size: 12px;border:1px solid #639ECE;"
trtd height="10" colspan="2"/td/tr
form action="userlogin.php"
tr
td width="60" align="right"用户名:/td
td width="220"input type="text" name="username"/td
/tr
tr
td/td
td align="center" input type="submit" value=" 登录 "/td
/tr
/form
trtd height="10" colspan="2"/td/tr
/table
/body
/html
?
}
?
Q3: 有哪些基于PHP+mysql的CMS建站程度,主要做行业网站,简单、易优化的。推荐几个
国内的有 PHPCMS(V9),DEDECMS、帝国CMS,
国外的有 Drupal , Joomla, Wordpress,
PHPCMS 现在是 V9 版本,官方称 用面向对象进行了重构,
DEDECMS在小企业用得比较多
Joomla 已经发展到了 2开头的版本,不过国内用的最多的还是其1.5 版本(一般是组件开发、个别插件)
Wordpress通常用来作为个人的博客程序(也有企业用作公司网站)
优化方面:PHPCMS、Wordpress都提供静态链接
难易度比较从易到难(个人觉得):
DEDECMS(帝国CMS) Wordpress PHPCMS Joomla Drupal
注:以上CMS充其量就是内容管理,关于订单管理还是建议使用商城程序,也很多,ecshop、shopEX、zen cart 、magento等等
简单的php加数据库网站的介绍就聊到这里吧,感谢你花时间阅读本站内容,更多关于如何用php创建数据库、简单的php加数据库网站的信息别忘了在本站进行查找喔。






