Snooble Posted May 30, 2007 Share Posted May 30, 2007 Hello everyone, I've been looking for so long now, i have a program that needs either: a connection string or a .udl file This is to connect to the database. Could you please help me out... If server = sql.server.com username = username password = password db = database what would the connection string look like with that information. Thank you, Any help is MUCH appreciated. Snooble Quote Link to comment https://forums.phpfreaks.com/topic/53572-confusing-experts-please/ Share on other sites More sharing options...
chigley Posted May 30, 2007 Share Posted May 30, 2007 <?php $conn = mysql_connect($server, $username, $password) or die(mysql_error()); mysql_select_db($db, $conn) or die(mysql_error()); ?> Quote Link to comment https://forums.phpfreaks.com/topic/53572-confusing-experts-please/#findComment-264762 Share on other sites More sharing options...
trq Posted May 30, 2007 Share Posted May 30, 2007 What kind of database is it your talking about? Quote Link to comment https://forums.phpfreaks.com/topic/53572-confusing-experts-please/#findComment-264763 Share on other sites More sharing options...
Snooble Posted May 30, 2007 Author Share Posted May 30, 2007 An SQL database. And it just says: Connection String: *I'm a text box* so what should i input. Thanks for your help so far Quote Link to comment https://forums.phpfreaks.com/topic/53572-confusing-experts-please/#findComment-264785 Share on other sites More sharing options...
trq Posted May 30, 2007 Share Posted May 30, 2007 SQL is a language, not a brand of database. Is it an MS SQL database? Connection String: *I'm a text box* so what should i input. Thanks for your help so far Where are you trying to connect from? Quote Link to comment https://forums.phpfreaks.com/topic/53572-confusing-experts-please/#findComment-264790 Share on other sites More sharing options...
Snooble Posted May 30, 2007 Author Share Posted May 30, 2007 I'm connecting to a MySQL database held on a server online. From a program called Automate. It says it passes an SQL statement to the datasource via OLEDB. Beneath the connection string it has the query box. I just need to know how i enter the information to connect to my sql server. because there's obviously some sort of format to the string. Thanks again Snooble Quote Link to comment https://forums.phpfreaks.com/topic/53572-confusing-experts-please/#findComment-264804 Share on other sites More sharing options...
trq Posted May 30, 2007 Share Posted May 30, 2007 Take a look here. Quote Link to comment https://forums.phpfreaks.com/topic/53572-confusing-experts-please/#findComment-264811 Share on other sites More sharing options...
Snooble Posted May 30, 2007 Author Share Posted May 30, 2007 Thanks, so i should use: Provider=MySQLProv;Data Source=mydb;User Id=myUsername;Password=myPassword; BUT, could you please run me through the difference. As i dont know where to put the host of the sql. (eg. localhost or sql15.ifastnet.com etc) Sorry to be a nightmare.. obviously the rest i understand. Thank you! Snooble Quote Link to comment https://forums.phpfreaks.com/topic/53572-confusing-experts-please/#findComment-264833 Share on other sites More sharing options...
trq Posted May 30, 2007 Share Posted May 30, 2007 Provider = host. Source = database name. User Id = you guessed it. Password = what? Quote Link to comment https://forums.phpfreaks.com/topic/53572-confusing-experts-please/#findComment-264837 Share on other sites More sharing options...
Snooble Posted May 30, 2007 Author Share Posted May 30, 2007 ... didn't work though... i get the error (couldn't connect to database). I was connecting using localhost. checked phpmyadmin settings to get the correct username and password... and used a database that's there. and said couldn't connect... maybe you cant connect locally? Any suggestions? Snooble Quote Link to comment https://forums.phpfreaks.com/topic/53572-confusing-experts-please/#findComment-264881 Share on other sites More sharing options...
trq Posted May 30, 2007 Share Posted May 30, 2007 Sorry, your posting a few conflicting stories. How are you actually trying to connect to this database? Through PHP or this automate thing? If its the later, your in the wrong forum. If its through php, post your code. Quote Link to comment https://forums.phpfreaks.com/topic/53572-confusing-experts-please/#findComment-264907 Share on other sites More sharing options...
Snooble Posted May 30, 2007 Author Share Posted May 30, 2007 It's just general, how to connect to an SQL server using a .udl file. I need to know what has to be in one. And where to put the server information. Snooble Quote Link to comment https://forums.phpfreaks.com/topic/53572-confusing-experts-please/#findComment-265220 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.