Turn on suggestions
Auto-suggest helps you quickly narrow down your search results by suggesting possible matches as you type.
Showing results for
PAYH - Connect to database from php
Topic Options
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page
- Plusnet Community
- :
- Forum
- :
- Help with my Plusnet services
- :
- Everything else
- :
- PAYH - Connect to database from php
PAYH - Connect to database from php
31-10-2008 8:44 AM
- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Highlight
- Report to Moderator
I have a plusnet (free-online) account and also a PAYH site.
I can connect to my PN database from my PN (ccgi) site and from my PAYH site.
I am trying to connect to my PAYH database from my PAYH site, but I keep getting an error.
Is there a different syntax required for connecting to the PAYH MySQL database?
I can't find any information at all on the PAYH site about this.
Here is what I am currently doing:
// free-online settings
$db_host = "rumpus.force9.net";
// Pay as you host settings:
// $db_host = "plesk-db01.plus.net";
$username = "XXXX";
$password = "XXXX";
$DB_name = "XXXX";
$chan = mysql_connect ($db_host, $username, $password);
mysql_select_db ($DB_name, $chan);
$sql = 'select ...
$result = mysql_query ($sql, $chan);
if ($myrow = mysql_fetch_array($result))
I can access the database fine using phpmyadmin through Plesk. I am using the same database name and password, and I can execute the same sql query with no problem.
The error I get from php is:
Warning: mysql_fetch_array(): supplied argument is not a valid MySQL result resource
Any suggestions appreciated.
TIA
Phil.
I can connect to my PN database from my PN (ccgi) site and from my PAYH site.
I am trying to connect to my PAYH database from my PAYH site, but I keep getting an error.
Is there a different syntax required for connecting to the PAYH MySQL database?
I can't find any information at all on the PAYH site about this.
Here is what I am currently doing:
// free-online settings
$db_host = "rumpus.force9.net";
// Pay as you host settings:
// $db_host = "plesk-db01.plus.net";
$username = "XXXX";
$password = "XXXX";
$DB_name = "XXXX";
$chan = mysql_connect ($db_host, $username, $password);
mysql_select_db ($DB_name, $chan);
$sql = 'select ...
$result = mysql_query ($sql, $chan);
if ($myrow = mysql_fetch_array($result))
I can access the database fine using phpmyadmin through Plesk. I am using the same database name and password, and I can execute the same sql query with no problem.
The error I get from php is:
Warning: mysql_fetch_array(): supplied argument is not a valid MySQL result resource
Any suggestions appreciated.
TIA
Phil.
Message 1 of 3
(970 Views)
2 REPLIES 2
Re: PAYH - Connect to database from php
31-10-2008 9:12 AM
- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Highlight
- Report to Moderator
(Having written of my deep disappointment am withholding the text of my experiences for 24 hours, to allow time for reflection, before publishing the sorry saga)
Message 2 of 3
(295 Views)
Re: PAYH - Connect to database from php
06-11-2008 10:38 AM
- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Highlight
- Report to Moderator
Check the db connection in your php with:
$chan = mysql_connect ($db_host, $username, $password);
if (!$chan)
echo "Unable to connect";
$sql = mysql_select_db(whatever, $chan);
if (!$sql)
echo "Unable to select";
Might help narrow it down.
$chan = mysql_connect ($db_host, $username, $password);
if (!$chan)
echo "Unable to connect";
$sql = mysql_select_db(whatever, $chan);
if (!$sql)
echo "Unable to select";
Might help narrow it down.
Message 3 of 3
(295 Views)
Topic Options
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page
- Plusnet Community
- :
- Forum
- :
- Help with my Plusnet services
- :
- Everything else
- :
- PAYH - Connect to database from php