Bazz1971
08-14-2012, 02:30 PM
Hi all, first time post here.
I have setup a wampsql database on my server on port 80 and I can pull data from the database using the PHP area within WAMP (c:\wamp\www\). I successfully accessed the database with the following code:
$con = mysql_connect("localhost","myusername","mypassword");
if (!$con)
**{
**die('Could not connect: ' . mysql_error());
**}
I am developing a web page that requires JavaScript so I have setup tomcat environement using a different port and installed Javabridge to give me PHP capability within tomcat.
My problem is if I reuse the above code it cannot see the swampsql database from my websites on tomcat. Is there a further information I can add to the following line so I can access the wampsql db from tomcat.:
$con = mysql_connect("localhost","myusername","mypassword"); ??
Any help much appreciated
Cheers
I have setup a wampsql database on my server on port 80 and I can pull data from the database using the PHP area within WAMP (c:\wamp\www\). I successfully accessed the database with the following code:
$con = mysql_connect("localhost","myusername","mypassword");
if (!$con)
**{
**die('Could not connect: ' . mysql_error());
**}
I am developing a web page that requires JavaScript so I have setup tomcat environement using a different port and installed Javabridge to give me PHP capability within tomcat.
My problem is if I reuse the above code it cannot see the swampsql database from my websites on tomcat. Is there a further information I can add to the following line so I can access the wampsql db from tomcat.:
$con = mysql_connect("localhost","myusername","mypassword"); ??
Any help much appreciated
Cheers