您的位置:首页 > 编程语言 > PHP开发

简单连接mysql,php语句手写

2011-10-24 01:23 274 查看
<?php

header('Content-Type: text/html; charset=utf-8');

$db=mysql_connect('localhost','qqtxt','zhh1981zhh');

if($db)

{

mysql_query("SET character_set_connection=utf8, character_set_results=utf8,character_set_client=binary");

mysql_select_db('a') or die('select_db failed');

set_magic_quotes_runtime(0);

//ini_set('magic_quotes_runtime','off');

echo $temp='update a set a=a中\国c where id=1'; echo '<br/>';

$result = mysql_query('update a set a="a中aaa国c" where id=1') or die('Query failed: ' . mysql_error());

$query = 'select * from a where id=1';

$result = mysql_query($query) or die('Query failed: ' . mysql_error());

while($row=mysql_fetch_array($result))

{

echo $row['a'];

}

//echo get_magic_quotes_runtime( );

}

?>
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: