x

[Closed] sql connection from a php page

<?php $strServer="localhost"; // Server IP Address Or Name $strDatabase="tripinfosource"; // Database Name $strUser="root"; // User ID $strPwd="root";// Password ?> the above is saved as conn.php

<?php include("conn.php"); $strDB=mysql_connect($strServer,$struser,$strPwd);//line 5 $database=mysql_select_db("$strDatabase",$strDB);//line 6

// The code for any database manipulation

mysql_close($strDB);//line 10 ?>

these were the warnings that appeared:- Warning: mysql_connect() [function.mysql-connect]: Access denied for user 'ODBC'@'localhost' (using password: YES) in C:\xampp\xampp\htdocs\sqlconn.php on line 5

Warning: mysql_select_db() expects parameter 2 to be resource, boolean given in C:\xampp\xampp\htdocs\sqlconn.php on line 6

Warning: mysql_close() expects parameter 1 to be resource, boolean given in C:\xampp\xampp\htdocs\sqlconn.php on line10

pls help me!!!!
more ▼

asked Oct 04, 2010 at 09:29 PM in Default

jovita gravatar image

jovita
1 1 1 1

(comments are locked)
10|1200 characters needed characters left

The question has been closed Oct 05, 2010 at 12:12 AM by Kev Riley for the following reason:


1 answer: sort voted first
more ▼

answered Oct 04, 2010 at 09:38 PM

CirqueDeSQLeil gravatar image

CirqueDeSQLeil
4.5k 10 11 15

Or go and ask those chaps over at StackOverflow.com
Oct 05, 2010 at 01:14 AM ThomasRushton ♦
(comments are locked)
10|1200 characters needed characters left

New code box

There's a new way to format code on the site - the red speech bubble logo will automatically format T-SQL for you. The original code box is still there for XML, etc. More details here.

Follow this question

By Email:

Once you sign in you will be able to subscribe for any updates here

By RSS:

Answers

Answers and Comments

SQL Server Central

Need long-form SQL discussion? SQLserverCentral.com is the place.

Topics:

x68
x5

asked: Oct 04, 2010 at 09:29 PM

Seen: 1011 times

Last Updated: Oct 05, 2010 at 12:12 AM