无法访问mysql中的数据库 [英] unable to access database in mysql
本文介绍了无法访问mysql中的数据库的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我无法访问数据库。我有这个代码
I am unable to access database. I have this code
<?php
$dbconnect = mysql_connect('127.0.0.1','ankurreyes','') or die('error onee');
mysql_select_db('likebutton',$dbconnect) or die('culdnt select database');
?>
它告诉我culdnt选择数据库
我检查了表名,它就像按钮一样。有人告诉我这是什么错,我在做什么?
when i load the page. it shows me culdnt select database
I checked table name, its likebutton .can someone tell me whats the mistake , I am doing?
推荐答案
dbconnect = mysql_connect(' 127.0.0.1',' ankurreyes',' ')或 die(' error onee');
mysql_select_db(' likebutton',
dbconnect = mysql_connect('127.0.0.1','ankurreyes','') or die('error onee'); mysql_select_db('likebutton',
dbconnect )或 die(' culdnt select database');我加载页面时,
?>
dbconnect) or die('culdnt select database'); ?>
它告诉我culdnt选择数据库
我检查了表名,它就像按钮一样。有人告诉我这是什么错,我在做什么?
when i load the page. it shows me culdnt select database
I checked table name, its likebutton .can someone tell me whats the mistake , I am doing?
mysql_select_db()
用于选择数据库而不是表格,请参阅: http://php.net/manual/en/function.mysql-select-db.php [ ^ ]
mysql_select_db()
is for selecting a database not a table see :http://php.net/manual/en/function.mysql-select-db.php[^]
这篇关于无法访问mysql中的数据库的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文