mysql_connect函数不起作用 [英] mysql_connect function isn't working

查看:100
本文介绍了mysql_connect函数不起作用的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

大家好。我最近用PHP 5.2和MySQL 5.1建立了Apache 2.2。我玩了一下SQL,现在我正试图用PHP访问它。我目前有代码:

展开 | 选择 | Wrap | 行号

解决方案

我当然不是专家,但它看起来像你的代码是合理的。

似乎我不喜欢php与mySql通信...我不是那个问如何修复的人。

问题仍然存在,为什么没有进一步的输出。您可以尝试使用数据库抽象层(例如 PDO )。当出现错误时,它们通常会更具响应性/信息性。


尝试这一点,看看它输出了什么(如果它输出了什么)。什么是错的,如果发生sql错误,你的phpcode将停止。因此,您需要将错误输出放在与出错的位置相同的行。

< span class =codeLinkonclick =Blur(this,this.parentNode.parentNode,getChildren(this),true);>展开 | 选择 | Wrap | 行号


Hi all. I''ve recently set up Apache 2.2 with PHP 5.2 and MySQL 5.1. I played around with SQL a bit, and now I''m trying to access it with PHP. I currently have the code:

Expand|Select|Wrap|Line Numbers

解决方案

I''m certainly no expert, but it looks to me like your code is sound.
Seems to me like php is not communicating with mySql... Which I''m not the person to ask how to fix.


still the question remains, why there is no further output. you could try using a database abstraction layer (e.g. PDO). they are usually more responsive/informative when it comes to errors.


try this and see what it outputs (if it outputs something). whats wrong is, if an sql error occurs, your phpcode wil stop. therefor you need to put the error-output on the same line as where you get the error.

Expand|Select|Wrap|Line Numbers


这篇关于mysql_connect函数不起作用的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆