I have an OC install in my root domain and a wordpress install in /blog.
I am trying to see if the user is logged into OC so I created a file with some of the OC code used in other files, (test.php) uploaded it to my /blog folder and called it in my browser. http://www.domain.co.uk/blog/test.php.
This returns the corect result and shows the user is logged into my OC shop. Great...Except for when I copy this code into the wordpress header.php (twentyeleven theme) When I then go to /blog I get the following errors:
Code: Select all
Warning: mysql_connect() [function.mysql-connect]: Access denied for user 'myprefix_myuser'@'localhost' (using password: YES) in /home/myprefix/public_html/system/database/mysql.php on line 6
Notice: Error: Could not make a database link using myprefix_myuser@localhost in /home/myprefix/public_html/system/database/mysql.php on line 7
Warning: mysql_select_db() expects parameter 2 to be resource, boolean given in /home/myprefix/public_html/system/database/mysql.php on line 10
Notice: Error: Could not connect to database myprefix_myuser in /home/myprefix/public_html/system/database/mysql.php on line 11
Warning: mysql_query() expects parameter 2 to be resource, boolean given in /home/myprefix/public_html/system/database/mysql.php on line 14
Warning: mysql_query() expects parameter 2 to be resource, boolean given in /home/myprefix/public_html/system/database/mysql.php on line 15
Warning: mysql_query() expects parameter 2 to be resource, boolean given in /home/myprefix/public_html/system/database/mysql.php on line 16
Warning: mysql_query() expects parameter 2 to be resource, boolean given in /home/myprefix/public_html/system/database/mysql.php on line 17
Has anybod got any ideas or a working way to check the customer is logged in froma new wordpress install?
Thank you.
Sarah
I ahve attached the 2 files I am using. The code from test.php is exactly the same as added to the top of hearder.php.