473,624 Members | 2,458 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

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 1589
Markus
6,050 Recognized Expert Expert
When you run phpinfo() do you see MySQL as a loaded extension?
Nov 14 '10 #2
Shenno
59 New Member
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
6437
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
2704
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 button, seems simple. I am using ALL visual controls (supposedly to simplify things. If I was not using the visual controls and calling an ExecuteNonQuery no prob. Please look at my code and tell me what I am doing wrong. Also, what are the advatages...
0
6050
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 FileMon and found out the mscorsvw.exe is continuously reading hard disk drive. It looked like that this process is belong to ".NET Runtime Optimization Service v2.0.50727_x64". But what is it doing exactly? Should I keep running this service (by...
16
1861
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 the form controls. I"m trying to do it solely thru code. You can safely assume I have an access datsabase with one table called who with three columns(fields). where did i go wrong ? OleDbConnection con;
1
1460
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 complaining that we are doing a CD.. in our connection prior to uploading. Once we signon, they claim we are "in" the correct folder. I have adopted this code from another programmer who is long gone. I do not see anything in this code that would...
9
4538
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 TypeOf obj Is IDisposable Then DirectCast(obj, IDisposable).Dispose()
16
1726
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 Nothing Then
9
1972
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, this generates an error.
1
4456
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 components", doing nothing (a copy of the dd_install_vs_procore_90.txt log is available here: http://pastebin.com/mf8b203 .. The dd_error_vs_procore_90.txt is empty. ). I was not able to google much for this but one similar problem with vs2005 suggested...
0
8175
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
8680
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, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
8625
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
8336
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
4082
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
4177
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
2610
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
1
1791
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
2
1487
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.