Page 1 of 1
problem with articles
Posted: Sat 28. Aug 2004, 19:40
by sean
Hi there,
once again I want to thank Oliver for such great upgrade. I updated my phpwcms to the latest version this morning, everything works great and all, but I have one small problem.
In the admin panel, the site structure shows all the previous structures that I had before the update, but when I got to "article center" to create a new article under those categories, I get the following error,
here is my "site structure"
and here is my "article center"
I also see all the old articles when I view my site, the only problem is that I can't see any of them or the categories in the "article center",
thank you.
Posted: Sat 28. Aug 2004, 20:58
by brans
did you upgrade the database too ?!? and did you upgrade from the last version ?!? or maybe an earlier version ?!?
Posted: Sat 28. Aug 2004, 21:30
by sean
Yes I did upgrade from the last version. As for the database, I didn't update anything or add anything from the phpmyadmin. Could you possibly tell me how to update the database as well? I tried to read the instructions with the files but there was only the copyright notice and the "under construction" for the instructions.
thank you.
Posted: Sat 28. Aug 2004, 21:55
by brans
oh man sorry I guess I was wrong! I've read about a problem with a fresh install! But you updated your version so I really don't know about what could be the solution ?!? maybe you should just try to run the upgrad script again ?!? did really everything pass well ?!? I guess it must have something to do with your database... maybe check if
this was correctly done during the update, otherwise post to the bugs forum!
Posted: Sat 28. Aug 2004, 22:03
by sean
ok will do, thanks again for you time bud
Posted: Sat 28. Aug 2004, 22:48
by DeXXus
sean wrote:Yes I did upgrade from the last version. As for the database, I didn't update anything or add anything from the phpmyadmin. Could you possibly tell me how to update the database as well?
While running the "upgrade.php", there is a dropdown box near the bottom that allows choice of .SQL files (by date). All choices "dated" after your previous version, should be selected and run, in order to add the updated structures to the database. Repeat this for all files dated more recently than your previous version date.
Posted: Sun 29. Aug 2004, 02:32
by sean
thanks again, I tried that and updated the last recent sql updated, but unfotunantly I still get the same error.
Posted: Sun 29. Aug 2004, 03:00
by DeXXus
There are at least two(2) that you ~MUST~ run if upgrading from last version (1.1-RC4_2004-06-22). If you had an earlier version... there are even more to be run. Just a "heads up"
Posted: Sun 29. Aug 2004, 20:17
by sean
DeXXus wrote:There are at least two(2) that you ~MUST~ run if upgrading from last version (1.1-RC4_2004-06-22). If you had an earlier version... there are even more to be run. Just a "heads up"
thanks again for the help, I tried to run the updates again, but it seems like that it has already been updated, cause it tells me that those tables/commands have already been processed and that they can't be duplicated or something. I still get the same error tho
thanks for the help again tho, really appericiate it.
Posted: Mon 30. Aug 2004, 00:59
by DeXXus
The error originates here in "admin.functions.inc.php":
Code: Select all
function struct_articlelist ($struct_id, $counter, $cut_article, $dbcon) {
$count_article = 0;
$sql = "SELECT article_id, article_cid, article_title, article_public, article_aktiv, article_uid, ".
"date_format(article_tstamp, '%Y-%m-%d %H:%i:%s') AS article_date FROM ".
DB_PREPEND."phpwcms_article WHERE article_cid='".$struct_id."' AND article_deleted=0 ".
"ORDER BY article_sort;";
if($result = mysql_query($sql, $dbcon) or die ("error while browsing related articles")) {
while($row = mysql_fetch_array($result)) {
$article[$count_article] = $row;
$count_article++;
}
mysql_free_result($result);
}
Re-check your "config.inc.php" to make sure your database values are all present and correct... including $phpwcms["db_prepend"]
Posted: Mon 6. Sep 2004, 20:59
by sean
hehe thanks.
After pulling my hair out for about a month, I finally fixed it and found out what was wrong with it.
in my admin.functions.inc I had this originally,
Code: Select all
function struct_articlelist ($struct_id, $counter, $cut_article, $article_order=0) {
$count_article = 0;
$article_order = intval($article_order);
$show_sort = (!$article_order || $article_order == 1) ? 1 : 0;
$ao = get_order_sort($article_order);
echo "\n\n\n".'<!-- ORDER: '.$ao[2].' //-->'."\n\n\n";
$sql = "SELECT article_id, article_cid, article_title, article_public, article_aktiv, article_uid, ".
"date_format(article_tstamp, '%Y-%m-%d %H:%i:%s') AS article_date FROM ".
DB_PREPEND."phpwcms_article WHERE article_cid='".$struct_id."' AND article_deleted=0 ".
"ORDER BY ".$ao[2].";";
//"ORDER BY article_sort;";
if($result = mysql_query($sql, $GLOBALS['db']) or die ("error while browsing related articles")) {
while($row = mysql_fetch_array($result)) {
$article[$count_article] = $row;
$count_article++;
}
mysql_free_result($result);
}
then, I kept looking back and forth with what DeXXus had pasted here, after doing tests over tests, i found out that this error could all be fixed if you just add
in here
Code: Select all
function struct_articlelist ($struct_id, $counter, $cut_article, $dbcon, $article_order=0) {
thanks again for the help, not sure if this would be a bug or just some random error, lol.