Jalenack
02-03-2005, 04:23 AM
mm...I've managed to work myself into a sticky situation.
I'm getting: Database error: [Unknown column 'language' in 'field list']
you can view the actual error at http://blog.jalenack.com
I am mysql illiterate and know some basic php. My host (dreamhost) is really confusing me with their mysql panel and all. Basically this one unknown table is breaking everything but my blog content..
I was updating my shortstat from v0.3b to v0.35 when it happened. The wordpress database is on a different database than the shortstat one (i'm pretty sure??). One thing about the new version of shortstat is they added a language module that displays what language is being used. Because i didn't care about it, i deleted the html that would display in my shortstat (http://blog.jalenack.com/shortstat/)...Here's the php for the language section in the function.php file of shortstat
function SI_getLanguage() {
include_once("languages.php");
global $SI_tables;
$query = "SELECT COUNT(*) AS 'total' FROM $SI_tables[stats] WHERE language != '' AND language != 'empty'";
if ($result = mysql_query($query)) {
if ($count = mysql_fetch_array($result)) {
$th = $count['total'];
}
}
$query = "SELECT language, COUNT(language) AS 'total'
FROM $SI_tables[stats]
WHERE language != '' AND
language != 'empty'
GROUP BY language
ORDER BY total DESC";
if ($result = mysql_query($query)) {
$html = "<table cellpadding=\"0\" cellspacing=\"0\" border=\"0\">\n";
$html .= "\t<tr><th>Language</th><th class=\"last\">%</th></tr>\n";
while ($r = mysql_fetch_array($result)) {
$l = $r['language'];
$lang = (isset($SI_languages[$l]))?$SI_languages[$l]:$l;
$per = number_format(($r['total']/$th)*100);
$per = ($per)?$per:'<1';
$html .= "\t<tr><td>$lang</td><td class=\"last\">$per%</td></tr>\n";
}
$html .= "</table>";
}
return $html;
}
could it be that the two databases are connected somehow or something...
So! For a solution, couldn't I write a php function that would delete the erroneus column in my database and restore everything? I haven't learned any mysql related php so I wouldn't know how to do it. I just don't want to mess up and then end up killing all my data stored. Please excuse my ignorance :p
I can't access my mysql tables directly for some weird reason. phpMyAdmin only displays my shortstat tables and nothing else.
I hope this is a simple fix...maybe i should contact tech support at Dreamhosts...thanks in advance! (I hope I was thorough enough :) )
I'm getting: Database error: [Unknown column 'language' in 'field list']
you can view the actual error at http://blog.jalenack.com
I am mysql illiterate and know some basic php. My host (dreamhost) is really confusing me with their mysql panel and all. Basically this one unknown table is breaking everything but my blog content..
I was updating my shortstat from v0.3b to v0.35 when it happened. The wordpress database is on a different database than the shortstat one (i'm pretty sure??). One thing about the new version of shortstat is they added a language module that displays what language is being used. Because i didn't care about it, i deleted the html that would display in my shortstat (http://blog.jalenack.com/shortstat/)...Here's the php for the language section in the function.php file of shortstat
function SI_getLanguage() {
include_once("languages.php");
global $SI_tables;
$query = "SELECT COUNT(*) AS 'total' FROM $SI_tables[stats] WHERE language != '' AND language != 'empty'";
if ($result = mysql_query($query)) {
if ($count = mysql_fetch_array($result)) {
$th = $count['total'];
}
}
$query = "SELECT language, COUNT(language) AS 'total'
FROM $SI_tables[stats]
WHERE language != '' AND
language != 'empty'
GROUP BY language
ORDER BY total DESC";
if ($result = mysql_query($query)) {
$html = "<table cellpadding=\"0\" cellspacing=\"0\" border=\"0\">\n";
$html .= "\t<tr><th>Language</th><th class=\"last\">%</th></tr>\n";
while ($r = mysql_fetch_array($result)) {
$l = $r['language'];
$lang = (isset($SI_languages[$l]))?$SI_languages[$l]:$l;
$per = number_format(($r['total']/$th)*100);
$per = ($per)?$per:'<1';
$html .= "\t<tr><td>$lang</td><td class=\"last\">$per%</td></tr>\n";
}
$html .= "</table>";
}
return $html;
}
could it be that the two databases are connected somehow or something...
So! For a solution, couldn't I write a php function that would delete the erroneus column in my database and restore everything? I haven't learned any mysql related php so I wouldn't know how to do it. I just don't want to mess up and then end up killing all my data stored. Please excuse my ignorance :p
I can't access my mysql tables directly for some weird reason. phpMyAdmin only displays my shortstat tables and nothing else.
I hope this is a simple fix...maybe i should contact tech support at Dreamhosts...thanks in advance! (I hope I was thorough enough :) )