473,327 Members | 2,112 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,327 software developers and data experts.

problems connecting to a database

Hi
I am very new to this...
I have set up apache2triad on one of my computers. I thought everything was going fine until I tried to connect to one of the databases I created with PHPmyAdmin.
The script I used is as follows
Expand|Select|Wrap|Line Numbers
  1. <?php
  2. $conn =new mysqli ("localhost","user","password","database");
  3. if (mysqli_connect_errno()) {
  4. printf("connect failed: %s\n", mysqli_connect_error());
  5. exit();
  6. } else {
  7. printf("Host Information: %s\n", mysqli_get_host_info($conn));
  8.  
  9. }
  10. ?>
Nothing happens at all - I don't get any error messages or host information.
Any suggestions would be really appreciated!
Oct 6 '07 #1
2 1004
ian44
1
Have you had any luck yet?
Oct 6 '07 #2
pbmods
5,821 Expert 4TB
Heya, Margie12. Welcome to TSDN!

Please use CODE tags when posting source code:

[CODE=php]
PHP code goes here.
[/CODE]

You'll want to use mysqli_connect_error() instead of mysqli_errno().
Oct 6 '07 #3

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

Similar topics

1
by: Geoff Soper | last post by:
I'm having problem with images becoming corrupted after loading them into a MySQL database and extracting them again. I'm pretty sure it's todo with escaping slashes but I'm at a loss as to how to...
1
by: Brad Pears | last post by:
Our graphic designer is developing our new company website. We have switched providers and currently she is working on the new website which currently ressides on the new providers server as they...
2
by: William F. O'Neill | last post by:
Have just upgraded my home installation of Oracle 10g. Was using 9i. The installation seemed to go fine, but with all the documentation, I'm having a hard time getting the Enterprise Manager to...
6
by: MBS | last post by:
Yeah, read the previous posts...I did that. None answer my question. I just installed PHP 5.0.4, Apache 2.0.54, and MySQL 4.1.13 a few days ago on WinXP SP2. My goal is to learn to use these...
3
by: Roy Souther | last post by:
Trying to get the unixODBC to work connecting to an IBM DB2 UDB V8.1. The DB2 server is running on Red Hat 8 and is tested and confirmed to be serving connections to Windows 98 clients using the...
0
by: Asim | last post by:
I seem to be having a lot of problems with running/developing web site on my XP Professional OS. I have a simple web site (using ASP/VB), which retrieves information from an Access 2000...
4
by: CodeImp | last post by:
A simple app I quickly wrote to try getting info from a database. Here is the first part of its code. The rest of the code is irellevant. using System; using System.Data; using...
1
by: Thomas Scheiderich | last post by:
I am having a problem connecting to an Sql Server using Windows Authentication. I am using the following command: server=Raptor;uid=tfs;password=tol1ee;database=ABC;Network Library =dbmssocn ...
3
by: BobLaughland | last post by:
Hi There, I am writing an ASP .NET 2.0 web site. I have a connection string in my web.config file similar to this for connecting to my database, SERVER=125.165.165.116,1092;...
0
by: ELINTPimp | last post by:
Hello folks, Having a bit of trouble getting PDO to connect to my remote MySQL database... PHP: 5.2.1, w/ php_mysql, php_pdo, php_pdo_mysql; error reporting is on, ERROR_STRICT (development...
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 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 former...

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.