Well this is frustrating. I'm working on trying to add the newest posts and summary to the front page of the site, and suddenly get a similar, if not same, problem. When I try to log into my N-13 admin page it says:
Warning: mysql_connect() [function.mysql-connect]: Can't connect to local MySQL server through socket '/tmp/mysql.sock' (2) in /data/25/2/98/45/2424045/user/2657060/htdocs/testSGHill/news/class/mysql.php on line 22
Warning: mysql_select_db() [function.mysql-select-db]: Can't connect to local MySQL server through socket '/tmp/mysql.sock' (2) in /data/25/2/98/45/2424045/user/2657060/htdocs/testSGHill/news/class/mysql.php on line 23
Warning: mysql_select_db() [function.mysql-select-db]: A link to the server could not be established in /data/25/2/98/45/2424045/user/2657060/htdocs/testSGHill/news/class/mysql.php on line 23
Warning: mysql_query() [function.mysql-query]: Can't connect to local MySQL server through socket '/tmp/mysql.sock' (2) in /data/25/2/98/45/2424045/user/2657060/htdocs/testSGHill/news/class/mysql.php on line 94
Warning: mysql_query() [function.mysql-query]: A link to the server could not be established in /data/25/2/98/45/2424045/user/2657060/htdocs/testSGHill/news/class/mysql.php on line 94
Warning: mysql_error(): supplied argument is not a valid MySQL-Link resource in /data/25/2/98/45/2424045/user/2657060/htdocs/testSGHill/news/class/mysql.php on line 105
Error:
Statement: SELECT * FROM news30_options WHERE 1
Arguments:
Array
(
)
I had added a RSS widget which I'd been playing with for about an hour with no problems, and also some code I found you wrote on the forum, trying to see which would work best. I took it all out, but I still am getting the error message. Before it went away after a couple of minutes and I could log into the admin page, but so far that's not been the case and it's been about 15 minutes.
I'm not sure if this is because of what I'm trying to do, or if it's just something else whacky. The php.ini file is still where I put it last night. I can log into phpMyAdmin for whatever that's worth or browse any non-N-13 page. It's just the N-13 admin that's not available,and any page using code that references it.
Hope you can figure out why - I'm stumped as to what to do. Thank you.
I had been playing with this from FeedWind
<!-- start feedwind code -->
<script type="text/javascript">
<!--
rssmikle_url="http://0329b6f.netsolhost.com/testSGHill/news/rss.php?feed=New%20Posts";
rssmikle_frame_width="613";
rssmikle_frame_height="550";
rssmikle_target="_top";
rssmikle_font_size="15";
rssmikle_border="on";
rssmikle_css_url="";
rssmikle_title="on";
rssmikle_title_bgcolor="#000000";
rssmikle_title_color="#FFFFFF";
rssmikle_title_bgimage="http://";
rssmikle_item_bgcolor="#FFFFFF";
rssmikle_item_bgimage="http://";
rssmikle_item_title_length="200";
rssmikle_item_title_color="#0953DF";
rssmikle_item_border_bottom="off";
rssmikle_item_description="on";
rssmikle_item_description_length="";
rssmikle_item_description_color="#666666";
rssmikle_item_description_tag="on";
rssmikle_item_podcast="off";
//-->
</script>
<script type="text/javascript" src="http://feed.mikle.com/js/rssmikle.js"></script>
<div style="font-size:10px; text-align:right;">
<a href="http://feed.mikle.com/en/" target="_blank" style="color:#CCCCCC;">FeedWind</a>
<!--Please display the above link in your web page according to Terms of Service.-->
</div>
<!-- end feedwind code -->
I had also had on the Show News Stats code from the N-13News support page.
When I took them all off the page displayed fine again, but I still can't get into my admin page. Also, I had been playing with the code (changing the size and color of options) for some time before this occurred. So it wasn't like as soon as I did it the problem happened.
Access: Admin
Total Posts: 1395
Joined: 2006-05-19
The error message
Code:
Can't connect to local MySQL server through socket '/tmp/mysql.sock' (2)
According to a network solutions forum means that in order for the script to connect to the database you need to use the IP address of the server as the mysql host.
If you edit the news/db.php file, you'll see this line
Code:
define('HOSTNAME', 'localhost');
Change 'localhost' to your MySQL servers IP address. You can find the IP address under your hosting control panel under the database manager.
Access: Admin
Total Posts: 1395
Joined: 2006-05-19
I see you changed it and it is now giving this error
Code:
Access denied for user 'root'@
The same file news/db.php, edit the other options in that file so that the username and password match your mysql database username and password and the database name is set correctly
I've filled in the fields and it's still giving me an error but I notice that it's saying it's using the pw YES which is not my pw. Unless it's just saying that Yes, it's using a pw? Obviously I don't want to post my login info here, but I don't mind pm'ing you my info if you think that would help.
I just found an error in what I had put in and changed the ip. It's a different error message now.
Error: No database selected
Statement: SELECT * FROM news30_options WHERE 1
Arguments:
Access: Admin
Total Posts: 1395
Joined: 2006-05-19
I have a feeling you somehow uploaded another copy of db.php which caused the problem. One thing I noticed is the way you're including the system into your design using a very round-about way. You're using a javascript feed system from another site, using it to load the news articles from the N-13 News rss feed then having the javascript system display the articles on your site.
Try this instead on your page where you want the news displayed, add the following code
Code:
<?php include 'news/index.php'; ?>
The page you add that code to, make sure it is a .php file and not a .html file. Once you've done that, to customize how your news gets displayed go to Options > Templates > Edit whichever template is selected > News.
There is some documentation describing how to integrate into your site properly here
Thanks. You're right, I am doing it a round about way. The simple include is fine except it links to the home page, not the news/index.php page. I know I read in the forum how to change that so I will look into that, as well as take a closer look at the documentation in the code.google.com location.
Always a learning curve with a new application, but it's nice because there are so many options and things you can do to customize N-13.