这是一款老外写的mysql php接受数据过来然后进行数据保存在mysql_real_escape_string(nl2br(strip_tags($_POST[\'comment\'])));我觉得写得我们有一点区别吧。
database config
*/
| 代码如下 | 复制代码 |
|
$db_host = 'localhost'; $link = mysql_connect($db_host,$db_user,$db_pass) or die('unable to establish a db connection'); mysql_select_db($db_database,$link);
$comment = mysql_real_escape_string(nl2br(strip_tags($_post['comment']))); $addon=''; mysql_query("insert into wave_comments set usr='".$user."', comment='".$comment."', dt=now()".$addon);
51shop 网上商城系统
查看详情
51shop 由 PHP 语言开发, 使用快速的 MySQL 数据库保存数据 ,为中小型网站实现网上电子商务提供一个完美的解决方案.一、用户模块1. 用户注册:用户信息包括:用户ID、用户名、用户密码、性别、邮箱、省份、城市、 联系电话等信息,用户注册后不能立即使用,需由管理员激活账号,才可使用(此功能管理员可设置)2. 登录功能3. 资料修改:用户可修改除账号以后的所有资料4. 忘记密码:要求用
0
if(mysql_affected_rows($link)==1) |
|
sql
--
-- table structure for table `wave_comments`
--
create table `wave_comments` (
`id` int(11) not null auto_increment,
`parent` int(11) not null default '0',
`usr` varchar(16) collate utf8_unicode_ci not null default '',
`comment` text collate utf8_unicode_ci not null,
`dt` datetime not null default '0000-00-00 00:00:00',
primary key (`id`),
key `parent` (`parent`,`id`)
) engine=myisam default charset=utf8 collate=utf8_unicode_ci;
--
-- dumping data for table `wave_comments`
--
insert into `wave_comments` values(1, 0, 'tutorialzine', 'this is a demo for a tutorialzine tutorial about creating a google wave-like history slider.
rnto get started, just drag the slider above, and this thread will be reverted to a past state.', '2009-10-24 03:58:08');
insert into `wave_comments` values(2, 0, 'curious', 'is html allowed in the comments?', '2009-10-24 03:59:44');
insert into `wave_comments` values(3, 2, 'tutorialzine', 'nope. also the messages in this demo are deleted every hour to prevent spamming.', '2009-10-24 04:00:15');
insert into `wave_comments` values(4, 1, 'tutorialzine', 'in this tutorial we are using php, mysql, jquery and css教程. the slider was created with jquery ui. view the tutorial.', '2009-10-24 04:01:34');
insert into `wave_comments` values(5, 2, 'curious', 'thanks! also i noticed that you can click, rather than drag the slider.great!', '2009-10-24 04:11:48');
PHP怎么学习?PHP怎么入门?PHP在哪学?PHP怎么学才快?不用担心,这里为大家提供了PHP速学教程(入门到精通),有需要的小伙伴保存下载就能学习啦!
Copyright 2014-2025 https://www.php.cn/ All Rights Reserved | php.cn | 湘ICP备2023035733号