mehulce
Posts: 4
|
| Posted: 02/01/2008, 11:01 AM |
|
I am accessing sqlsever database which is on other sever..
I tried this script and it is working fine in local PC where internet is there. I tested in 2 different local machines and it worked fine at both place.
$dsn = "DRIVER={SQL Server};Server=IP,Port;Database=Dbname;";
$conn = odbc_connect($dsn,'userid','passsword') or die("can't connect to database");
$query="SELECT *FROM sysdba.LEADSOURCE";
$result=odbc_exec($conn,$query);
while(odbc_fetch_row($result)){
echo odbc_result($result,0);
echo "<br>";
}
But when I upload it to webserver it gave me an error can't connect to database.
Any clue?
|
 |
 |
mamboBROWN
Posts: 1713
|
| Posted: 02/02/2008, 3:28 PM |
|
mehulce
What is your environment setup on the webserver that you a uploading the software to(Windows or Linux...Apache or IIS...)??
|
 |
 |
mehulce
Posts: 4
|
| Posted: 02/02/2008, 6:27 PM |
|
How would i know that?
I only know it has support to run PHP and Mysql. And also i check Phpinfo().
I has also ODBC support.
|
 |
 |
mamboBROWN
Posts: 1713
|
| Posted: 02/03/2008, 1:21 PM |
|
mehulce
Phpinfo() actually tells you about the environment. It will list the OS, web server and php settings. This way we can possibly give you more assistance.
|
 |
 |
ignitesystems
Posts: 7
|
| Posted: 02/07/2008, 5:47 AM |
|
If you are trying to access a remote database then there is probably a setting on the MYSQL console for 'REMOTE ACCESS HOSTS PERMISSIONS' it may be set to allow only local access.
You can however populate it with % to allow all connections to the database. If you are using a cpanel hosting account then this option is in the MYSQL bit of cpanel.
REMEMBER I AM TALKING ABOUT THE SETTING OF THE DATABASE YOU ARE CONNECTING TO. Not a setting on CCS or your local side.
|
 |
 |
mehulce
Posts: 4
|
| Posted: 02/07/2008, 9:57 AM |
|
I have done it..
Thanks guyes for you your kind help..
|
 |
 |