473,404 Members | 2,195 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,404 software developers and data experts.

mysql_connect() doing nothing at all

Hi there!

I read here the same named question topic, and a lot of other pages with this name, but I can't find any solution for my problem.

I have PHP 5.2.14.
I have Apache 2.2.17
I have MySQL 5.1.52 (32bit)
I use Win7 32bit.

After PHP+Apache installation, I tested php with phpinfo(), it work. Everything looks fine. I write any php code except using MySQL everything is fine.

I deleted in the php.ini the ; before the mysql.dll-s, and the ext folder is correc, Phpinfo() seems to be good (there is the mysql section); When I use MySQL in command line with pass it's fine. So they (PHP and MySQL) work separated OK but together NOT!

But when I write this code, doing nothing, I got a really blank page in Chorme, and IE, Firefox offer a downloadable blank php file... without any error messages.

Expand|Select|Wrap|Line Numbers
  1. <html>
  2. <body>
  3. <?php
  4.  
  5. error_reporting(E_ALL);
  6. ini_set('display_errors', 'on');
  7.  
  8. echo "Working?<br>";
  9.  
  10. $config['host'] = '127.0.0.1'; //host name
  11. $config['user'] = 'user'; //database username
  12. $config['pass'] = 'pass'; //database password
  13.  
  14. $link = mysql_connect($config['host'],$config['user'],$config['pass']) or die ('Something wrong : ' . mysql_error());
  15.  
  16. echo "WORK!<br>";
  17.  
  18. ?>
  19. </body>
  20. </html>
  21.  
  22.  
What can I do?

I didn't found any of solutions. I use 32 bit operation systems and 32 bit MySQL this is not a problem...

THANKS for Your help!

Bye,
Zoli
Nov 14 '10 #1
2 1575
Markus
6,050 Expert 4TB
When you run phpinfo() do you see MySQL as a loaded extension?
Nov 14 '10 #2
Shenno
59
check hosts file on windows, map 127.0.0.1 to localhost.

try use "localhost" on your code..

u can also use echo mysql_error(); before die(); to find out whats wrong.
Nov 15 '10 #3

Sign in to post your reply or Sign up for a free account.

Similar topics

4
by: Sarah Haff | last post by:
Hi, What would be minimilistic XSLT that does "nothing" (no transformation) to the given XML content. Thank you. Sarah Haff
2
by: Aaron Ackerman | last post by:
I cannot a row to this bound DataGrid to SAVE MY LIFE! I have tried everything and I am at a loss. The using goes into add mode with the add button adds his data then updates with the update...
0
by: Sin Jeong-hun | last post by:
I'm using Windows XP x64 edition, and I have just installed .NET Framework 2.0 (x64). When I was doing nothing with my computer the hard disk started making noises and the LED was blinking. I used...
16
by: SLIMSHIM | last post by:
Hi, I"m new to c# and .net. I wrote a small program to add rows to an access table. the program goes thru the motions but the data never gets there. here is my code. I am intentionaly not using...
1
by: Ben Kim | last post by:
Hello all, We are connecting to a remote server using FTP and sending up 100's of files daily to this site. I just received a call from the operations manager of this site and they are...
9
by: Doug Glancy | last post by:
I got the following code from Francesco Balena's site, for disposing of Com objects: Sub SetNothing(Of T)(ByRef obj As T) ' Dispose of the object if possible If obj IsNot Nothing AndAlso...
16
by: shapper | last post by:
Hello, I have a generic list as follows: Dim rows As New Generic.List(Of row) Now I have a row: Dim myRow As row I tried to check, further in my code, if the row is nothing: If myRow Is...
9
by: oddvark | last post by:
Hello, under vc7.1 this code compiles: if (!parent.fillTool) parent.fillTool.dispose; where dispose is a method of fillTool. Notice that dispose does not have ( ) behind it. Under vc8,...
1
by: fostandy | last post by:
Howdy, I have a fresh install of vista ultimate sp1 which I am trying to install visual studio 2008 to. When I run the installer it basically stalls at "Setup is loading installation...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.