473,323 Members | 1,560 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,323 software developers and data experts.

Connection Problems

I have windows 2000 server with sp4
I m using php 5.*
mysql 5.*
& IIS

I am not able to connect the MySQL using function mysql_connect or mysqli_connect()

It is giving error that is
Parst error: parse error, unexpected T_LNUMBER, expecting T_VARIABLE or '$' ub C:\program files\Apachegroup\...\on line 5

I have also edited php.ini & uncomment the php_mysql.dll

but it is giving erroe as PHP startup: unable to load dynamic library './php_mysql.dll'- the specified module could not be found

my php code is
[php]
<?php
$username = "myuser";
$password = "mypass";
$hostname = "localhost";
$dbh = mysql_connect($localhost, $myuser, $mypass)
or die("Unable to connect to MySQL");
print "Connected to MySQL<br>";
// you're going to do lots more here soon
mysql_close($dbh);
?>[/php]

what should I do?
Any one can help me plz? :(
Oct 15 '06 #1
2 1183
ronverdonk
4,258 Expert 4TB
Should it not be better to do this:
[php]
$username = "myuser";
$password = "mypass";
$hostname = "localhost";
$dbh = mysql_connect($hostname, $username, $password)
[/php]
Ronald :cool:
Nov 10 '06 #2
Nert
64
I am not able to connect the MySQL using function mysql_connect or mysqli_connect()

It is giving error that is
Parst error: parse error, unexpected T_LNUMBER, expecting T_VARIABLE or '$' ub C:\program files\Apachegroup\...\on line 5

I have also edited php.ini & uncomment the php_mysql.dll

but it is giving erroe as PHP startup: unable to load dynamic library './php_mysql.dll'- the specified module could not be found

my php code is
[php]
<?php
$username = "myuser";
$password = "mypass";
$hostname = "localhost";
$dbh = mysql_connect($localhost, $myuser, $mypass)
or die("Unable to connect to MySQL");
print "Connected to MySQL<br>";
// you're going to do lots more here soon
mysql_close($dbh);
?>[/php]

what should I do?
Any one can help me plz? :(
hi,

if you have uncommented the php_mysql.dll you should have the libmysql.dll and php_mysql.dll on your php root folder.

and try to use code something like this.

<?
mysql_connect('hostname', 'username', 'password') or die('error : '.mysql_error);
echo 'Successfully connected to MySql Server';
?>
although it's the same as your coding but i just preffer using something like that code hehehe..

bye -- bye

-- nert
Nov 11 '06 #3

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

Similar topics

1
by: Cliff Cooley | last post by:
Can anybody suggest what may be causing the following problem ? I have an ASP script that opens a connection to an Oracle database using a DSN connection string, such as : Set dbConn=...
8
by: Peter Larsson | last post by:
Hi there, I've recently developed a VBA-program in Excel that fetches and presents data from a distant Access database over a wireless peer-to-peer network (both computers running Win XP Pro)....
9
by: mcbill20 | last post by:
Hello all. I just installed Oracle 10g developer tools on a machine running XP Pro and Office XP. Before this I had just the Oracle 9 client installed. I the previous configuration, I was able to...
2
by: Jim Heavey | last post by:
How do I set up a Connection Pool? How can I look on the server and see how many connections are being used by my application? I am pretty sure that my application must be leaving connections...
10
by: Daniel Fernandes | last post by:
Hi there Let's say due to several reasons I have an ASP.Net application that has a database access class that stores a database connection in a shared member : public class dataaccess ...
7
by: mfeingold | last post by:
I am working on a system, which among other things includes a server and a ..net control sitting in an html page and connected to the server. I ran into a couple of problems, you guys might have...
26
by: Rajeev Tipnis | last post by:
http://support.microsoft.com/default.aspx?scid=kb;en- us;819450 Questions: 1) Is this patch (fix) applicable to the .NET 1.1 Framework as well? That is, if we have Framework 1.1 (On...
4
by: Susan Baker | last post by:
PHP Newbie here - I apologize if any of my questions appear daft or obvious ... Does PHP (or maybe the web server - Apache in my case), support (database) connection pooling?. It seems terribly...
17
by: Alan Silver | last post by:
Hello, I have a generic method in a utility class that grabs an sqldatareader and returns it. Due to the fact that (AFAIK), you can't close the database connection before you've read the data,...
4
by: Fred Zuckerman | last post by:
I have a A2K database that includes some linked tables (these links are SQL views). Sometimes there are "issues" with the SQL server and the users receive a timeout error whenever they try to...
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...
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: 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: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
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...
1
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you
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.