试图在php文件中出错并且无法正常工作

时间:2013-08-21 00:56:40

标签: php

我试图在视频http://www.youtube.com/watch?v=0ol6C0ETQqM&list=PLE134D877783367C7中的代码中出错,我认为问题出在mysql_connect

代码

<?php
$connect_error = 'Sorry we\'re experiencing connection problems.';
mysql_connect('localhst', 'root', '') or die ($connect_error);
mysql_select_db('lr'); or die ($connect_error);
?>

1 个答案:

答案 0 :(得分:0)

mysql_select_db('lr')之后删除分号:

$connect_error = "Sorry we're experiencing connection problems.";
mysql_connect('localhst', 'root', '') or die ($connect_error);
mysql_select_db('lr') or die ($connect_error);