x
login about faq Site discussion (meta-askssc)

[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:xamppxampphtdocssqlconn.php on line 5

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

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

pls help me!!!!

more ▼

asked Oct 04 '10 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 '10 at 12:12 AM by Kev Riley for the following reason:


1 answer: sort voted first

Try the following reference for MySql and PHP http://php.net/manual/en/function.mysql-connect.php

more ▼

answered Oct 04 '10 at 09:38 PM

CirqueDeSQLeil gravatar image

CirqueDeSQLeil
3.9k 6 11 15

Or go and ask those chaps over at StackOverflow.com

Oct 05 '10 at 01:14 AM ThomasRushton ♦
(comments are locked)
10|1200 characters needed characters left

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



Facebook logo Follow Ask SSC on Facebook
Find Ask SSC on Google+
linkedin logo Find us on LinkedIn

Topics:

x52
x3

asked: Oct 04 '10 at 09:29 PM

Seen: 527 times

Last Updated: Oct 05 '10 at 12:12 AM

Copyright © 2002-2012 Simple Talk Publishing. All Rights Reserved. If you have any queries, please contact the site administrators.
Ask SQL Server Central is a community service provided by Red Gate.