utahnix Posted June 4, 2008 Share Posted June 4, 2008 I have this CMS system I'm preparing to debut (online newspaper). I've integrated OpenX (local/php ad distribution), and all seems okay. ... except this occasional problem. There are no errors, but my content doesn't load! The site executes correctly, but there's nothing there to read. The ads display, but the content (in the database I created) is empty. A refresh fixes it... for that time. But the bug pops up once every 15-20 minutes, as I'm clicking through various articles. I've isolated the problem to a OOP library that I wrote (it queries the MySQL database for the article, which is stored in a MyISAM table). For some reason, I get no data (empty set). I'm not sure if this is a PHP problem, or a MySQL problem. Here it is: $select = mysql_query ("SELECT gid,pubdate,year(pubdate) as year,month(pubdate) as month,day(pubdate) as day,date_format(pubdate,\"%M %e, %Y\") as date_human, datediff(curdate(), pubdate) as days_old, section,sectname,article,headline,author,body,proofed,legacy,views,lastread from archives LEFT JOIN readcount USING (gid) where GID=\"$gid\" and PROOFED=\"$proofed\""); $sqlObj = mysql_fetch_object ($select); I have been echoing the SQL code (on the web page), and then running it directly through MySQL, and it works fine. So I'm at a loss about where the problem is. I have two tables here... archives (MyISAM - article content) and readcount (InnoDB - article view tally). The GID field is common between them (joint field). Again, this works fine 90% of the time, but it is a big enough problem that I need to fix it. I've looked at the MySQL side... used mytop, mysqladmin, etc. I don't **think** anything is out of the ordinary (server status variables). But who knows... at this point, I'm ready to pull my hair out. Ideas, thoughts? Link to comment https://forums.phpfreaks.com/topic/108637-random-phpmysql-problem/ Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.