CodeCharge Studio
search Register Login  

Visual PHP Web Development

Visually Create Internationalized Web Applications, Web Reports, Calendars, and more.
CodeCharge.com

YesSoftware Forums -> CodeCharge Studio -> PHP

 odbc_connect is not working on web server.

Print topic Send  topic

Author Message
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?
View profile  Send private message
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...)??
View profile  Send private message
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.

View profile  Send private message
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.
View profile  Send private message
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.
View profile  Send private message
mehulce

Posts: 4
Posted: 02/07/2008, 9:57 AM

I have done it..

Thanks guyes for you your kind help..
View profile  Send private message

Add new topic Subscribe to topic   


These are Community Forums for users to exchange information.
If you would like to obtain technical product help please visit http://support.yessoftware.com.

Internet Database

Visually create Web enabled database applications in minutes.
CodeCharge.com

Home   |    Search   |    Members   |    Register   |    Login


Powered by UltraApps Forum created with CodeCharge Studio
Copyright © 2003-2004 by UltraApps.com  and YesSoftware, Inc.