我对 php 和 mysql 比较陌生,我的 mysql 有问题。这是我遇到的一个错误,我已经尝试了我所知道的一切。所以从错误中我只能假设它是一个套接字问题。这是错误:
Warning: mysql_connect() [function.mysql-connect]: Can't connect to local MySQL server through socket '/tmp/mysqld.sock' (2) in /homepages/35/d372939724/htdocs/mypetdetective.org/posting.php on line 26
无法连接
这是php文件:
<?php
$posting_title = $_POST['post_title'];
$post_des = $_POST['post_des'];
$dbc = mysqli_connect('localhost', '__MUNGED__', '__MUNGED__' ,'__MUNGED__')
or die( 'Could not Connect' );
$query = "INSERT INTO lost_cat(title,description)".
"VALUES('$posting_title','$post_des')";
mysqli_query($dbc,$query)
or die('error in query');
mysqli_close($dbc);
echo '<b class="lom">' . $posting_title . '</b>' .'<br />';
echo '<hr />';
echo $post_des . '<br />';
?>