这是一款老外写的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);
Landolphin值得买返利系统
查看详情
Landolphin值得买返利系统是由流行的PHP语言开发的一套值得买程序。 程序拥有模板保护、模板和程序分离(只要你会做模板即使不会PHP编程也可以做漂亮的模板)、模板缓存、数据库缓存、局部缓存、BUG报错等实用性功能。
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号