<?php
$conn=mysql_connect("localhost","admin","admin");
mysql_select_db("lucy1015",$conn);
mysql_query("SET NAMES gbk");
error_reporting(0);
function shili ( $x ){
$sql=mysql_query("select * from phpcms_yuyan where english='$x'",$conn);
$info=mysql_fetch_array($sql);
echo $info[chinese];
echo $info[english]; }shili ( jobs ) ; ?>
数据库结构如下
id english chinese 1 jobs 工作
2 girls 女孩
3 boys 男孩
---------------------
$conn=mysql_connect("localhost","admin","admin");
mysql_select_db("lucy1015",$conn);
mysql_query("SET NAMES gbk");
error_reporting(0);
function shili ( $x ){
$sql=mysql_query("select * from phpcms_yuyan where english='$x'",$conn);
$info=mysql_fetch_array($sql);
echo $info[chinese];
echo $info[english]; }shili ( jobs ) ; ?>
数据库结构如下
id english chinese 1 jobs 工作
2 girls 女孩
3 boys 男孩
---------------------
解决方案 »
- 求smarty 的三级分类!
- 关于DISCUZ的一个问题
- OB_start 缓存输出后为乱码
- 我安装了Apache HTTP Server,但安装php时找不到相应的web server
- input 一个动态得到的数值时,无法显示
- PHP Web MVC 框架 CodeIgniter 中国网站及社区正式上线!
- 谁有PHP和MySQL Web开发(附光盘原书第3版)中文版的
- 请问PHP如何实现类似MSN Messenger的点对点文件传输
- mssql->mysql 后为何出现'\r\n'字符
- 请求帮助:关于PHP、APACHE和MYSQL的几个问题。请各位兄长多多指教!(绝对给分!!!)
- php 如何实现 做新闻列表时,每五条新闻加一条虚线
- 首页出现warning
$sql=mysql_query("select * from phpcms_yuyan where english='$x'");
$info=mysql_fetch_array($sql);
echo $info[chinese];
echo $info[english]; }shili ( 'jobs' ) ;
你把 error_reporting(0); 去掉!!!
Notice: Use of undefined constant chinese - assumed 'chinese' in D:\PC_webserver\phproot\yuyan2.php on line 14
招聘求职
Notice: Use of undefined constant english - assumed 'english' in D:\PC_webserver\phproot\yuyan2.php on line 15
jobs
Notice: Use of undefined constant japanese - assumed 'japanese' in D:\PC_webserver\phproot\yuyan2.php on line 16
募集
你把$info[chinese]改成$info['chinese']就可以了。
error_reporting(E_ALL & ~E_NOTICE);正式运行时
error_reporting(0);