Hello
In DWMX 61, I am trying to establish a connection with my MySQL database.
I had DW create it for me, and when DW checks it, it reports a working connection.
However, when I want to use that connection in a script, the string that represents the connection is rendered as "Resource Id #1". Consecutive uses of the connection variable will increase the reported ID number.
This is the code in the DW connector:
::::::::::::::::::::::::::::::::::::
<?php
# FileName="Connection_php_mysql.htm"
# Type="MYSQL"
# HTTP="true"
$hostname_connAldfaer = "localhost";
$database_connAldfaer = "aldfaer_db";
$username_connAldfaer = "MyUsername";
$password_connAldfaer = "MyPassword";
$connAldfaer = mysql_pconnect($hostname_connAldfaer, $username_connAldfaer, $password_connAldfaer) or die(mysql_error());
echo '$hostname_connAldfaer: '. $hostname_connAldfaer.'<br>';
echo '$database_connAldfaer: '. $database_connAldfaer.'<br>';
echo '$username_connAldfaer: '. $username_connAldfaer.'<br>';
echo '$password_connAldfaer: '. $password_connAldfaer.'<br>';
echo '$connAldfaer: '.$connAldfaer;
?>
::::::::::::::::::::::::::::::::::::
When viewed in a browser, it says:
:::::::::::::::::::::::::::::::::::::
$hostname_connAldfaer: localhost
$database_connAldfaer: aldfaer_db
$username_connAldfaer: MyUsername
$password_connAldfaer: MyPassword
$connAldfaer: Resource id #2
:::::::::::::::::::::::::::::::::::::
I am sure I have overlooked a very simple thing, but I cannot figure out what. Afterall, I am a beginner in PHP.
Anyone a suggestion?
-t-
Tom Jacobs