Error while creating new article content

Get help with installation and running phpwcms here. Please do not post bug reports or feature requests here.
Volk
Posts: 15
Joined: Sun 20. Feb 2005, 19:08

Error while creating new article content

Post by Volk »

I got the following error message if I want to create new article content:

error while creating new article content
sql: SELECT DISTINCT *, date_format(article_tstamp, '%Y-%m-%d %H:%i:%s') AS article_date FROM phpwcms_article LEFT JOIN phpwcms_articlecat ON phpwcms_article.article_cid=phpwcms_articlecat.acat_id WHERE phpwcms_article.article_id='8' LIMIT 1;

What I'm doing wrong? :(

(Running phpwcms 1.2.1-Dev)

Volk
Pappnase

Post by Pappnase »

hello

look like you have problems with the db! was it an new install or an upgrade!?
Volk
Posts: 15
Joined: Sun 20. Feb 2005, 19:08

Post by Volk »

look like you have problems with the db! was it an new install or an upgrade!?
It's a new installation.

Any idea to solve the problem?
Pappnase

Post by Pappnase »

hello

maybe there was a problem with the db at the setup. sop please drop all phpwcms tabels from teh db and reinstall.

and don#t forget to check the box "Create all tables" at the first setup screen.
Volk
Posts: 15
Joined: Sun 20. Feb 2005, 19:08

Post by Volk »

Hello again,
maybe there was a problem with the db at the setup. sop please drop all phpwcms tabels from teh db and reinstall.

and don#t forget to check the box "Create all tables" at the first setup screen.
I have

- drop the db
- create new db
- reinstall WCMS
- create all tables at he first setup screen (I can see the tables with phpMyadmin)

Same problems as before. Very frustrated...

Volk
Pappnase

Post by Pappnase »

hello

wich php / mysql vversion is running on you space!?
Volk
Posts: 15
Joined: Sun 20. Feb 2005, 19:08

Post by Volk »

Hi Pappnase,
wich php / mysql vversion is running on you space!?
PHP 4.3.10
MySQL 4.0.23
phpMyAdmin 2.6.1

on localhost (Windows XP, Apache)

Volk
Karla
Posts: 223
Joined: Tue 26. Oct 2004, 11:56

Post by Karla »

Just for grins... Try changing "upper case" of variable name $SQL to "lower case" $sql
in file "article.editcontent.inc.php" line 296.
FROM

Code: Select all

$SQL  = "INSERT INTO ".DB_PREPEND."phpwcms_articlecontent SET " . $SQL;
TO

Code: Select all

$SQL  = "INSERT INTO ".DB_PREPEND."phpwcms_articlecontent SET " . $sql;
BECAUSE
I ~think~ your db query string came from
HERE

Code: Select all

$sql =	"SELECT DISTINCT *, date_format(article_tstamp, '%Y-%m-%d %H:%i:%s') AS article_date ".
		"FROM ".DB_PREPEND."phpwcms_article LEFT JOIN ".DB_PREPEND."phpwcms_articlecat ON ".
		DB_PREPEND."phpwcms_article.article_cid=".DB_PREPEND."phpwcms_articlecat.acat_id WHERE ".
		DB_PREPEND."phpwcms_article.article_id='".$article["article_id"]."' LIMIT 1;";
Volk
Posts: 15
Joined: Sun 20. Feb 2005, 19:08

Post by Volk »

Hi Karla,
Try changing "upper case" of variable name $SQL to "lower case" $sql
in file "article.editcontent.inc.php" line 296.
FROM
Code:
$SQL = "INSERT INTO ".DB_PREPEND."phpwcms_articlecontent SET " . $SQL;
TOCode:
$SQL = "INSERT INTO ".DB_PREPEND."phpwcms_articlecontent SET " . $sql;
I have changed to lower case. I did'nt get the error message any more, but I also did'nt get the Screen to input the content.

I have selected

Inhaltsart: Einfacher Text
Status sichtbar

and clicked on Erstellen but nothing happend...

Volk
Karla
Posts: 223
Joined: Tue 26. Oct 2004, 11:56

Post by Karla »

I'm sorry for the wild chase... was just curious if that SQL query was the last to be executed. I suspect not, because it should go on to build the article content from lines 262-296 here:

Code: Select all

			if(!isset($content["error"])) { //if no error
			
				$SQL  = "acontent_aid		= '".$content["aid"]."', ";
				$SQL .= "acontent_uid		= '".$_SESSION["wcs_user_id"]."', ";
				$SQL .= "acontent_title		= '".aporeplace($content["title"])."', ";
				$SQL .= "acontent_subtitle	= '".aporeplace($content["subtitle"])."', ";
				$SQL .= "acontent_type		= '".$content["type"]."', ";
				$SQL .= "acontent_sorting	= '".$content["sorting"]."', ";
				$SQL .= "acontent_visible	= '".$content["visible"]."', ";
				$SQL .= "acontent_before	= '".$content["before"]."', ";
				$SQL .= "acontent_after		= '".$content["after"]."', ";
				$SQL .= "acontent_top		= '".$content["top"]."', ";
				$SQL .= "acontent_block		= '".$content["block"]."', ";
				
				$WHERE = '';
				
				// load SQL addition for special content part
				if(file_exists("include/inc_lib/content/cnt".$content["type"].".sql.inc.php")) {
					include("include/inc_lib/content/cnt".$content["type"].".sql.inc.php");
				} else {
					include("include/inc_lib/content/cnt0.sql.inc.php");
				}
				
			
				if(!$content["id"]) { //if new content part should be created
					/*
					if(file_exists("include/inc_lib/content/cnt".$content["type"].".insert.inc.php")) {
						include("include/inc_lib/content/cnt".$content["type"].".insert.inc.php");
					} else {
						include("include/inc_lib/content/cnt0.insert.inc.php");
					}
					*/
					
					// use SET method for INSERT too
					$SQL  = "INSERT INTO ".DB_PREPEND."phpwcms_articlecontent SET " . $SQL;
cyrano
Posts: 1598
Joined: Sat 31. Jan 2004, 18:33
Location: Stuttgart
Contact:

Post by cyrano »

hi,

had seen on one installation the same error.

set SQL to sql but makes no difference -any more suggestions therefore?

error

Code: Select all

error while connecting to database
INSERT INTO db_webdes_phpwcms_article (article_cid, article_uid, article_username, article_title, article_keyword, article_public, article_aktiv, article_begin, article_end, article_subtitle, article_redirect, article_sort, article_notitle, article_created, article_cache, article_nosearch) VALUES ('13','1',xxxxx,'vbb','','1','1','2005-02-26 22:37:38','2010-12-31 23:59:59','','', 0,0, '1109453858', '', '');
thank you.
Gruß/ regards cyrano
--------------------------------------------------------
templates -> http://www.128.weitzelmedia.de
planepix -> http://www.planepix.de
XING -> https://www.xing.com/profile/Thomas_Weitzel3
cyrano
Posts: 1598
Joined: Sat 31. Jan 2004, 18:33
Location: Stuttgart
Contact:

Post by cyrano »

Hi,

does someone knows what happens here with the error shown above?
Is this a structural problem with the database?
Possible to repair? or does it seems we need to re-install all?

thank you in advance.
Gruß/ regards cyrano
--------------------------------------------------------
templates -> http://www.128.weitzelmedia.de
planepix -> http://www.planepix.de
XING -> https://www.xing.com/profile/Thomas_Weitzel3
User avatar
pico
Posts: 2595
Joined: Wed 28. Jul 2004, 18:04
Location: Frankfurt/M Germany
Contact:

Post by pico »

Hi

in first Line you read this in the Error
error while connecting to database
think that this is what you have to investigate :?:
Lieber Gott gib mir Geduld - ABER BEEIL DICH
Horst - find me at Musiker-Board
cyrano
Posts: 1598
Joined: Sat 31. Jan 2004, 18:33
Location: Stuttgart
Contact:

Post by cyrano »

hi pico,

yes i read this, but don't know what's to do next and where to dig?

I can move articles so there is a contact to the DB, but cannot add more structure levels or articles.

So which part is to reinstall or which part in mysqladmin must be changed/added/updated?

Thank you for reply pico.

SOLVED: There was some missing table field, why? I don't know.
Last edited by cyrano on Tue 8. Mar 2005, 17:38, edited 1 time in total.
Gruß/ regards cyrano
--------------------------------------------------------
templates -> http://www.128.weitzelmedia.de
planepix -> http://www.planepix.de
XING -> https://www.xing.com/profile/Thomas_Weitzel3
nosmile
Posts: 19
Joined: Mon 25. Oct 2004, 17:08
Location: Poland

did someone solve this problem?

Post by nosmile »

Hi.
I've just encountered almost the same thing:
I can't create article contents - there is no screen to input the content.
I can't even create summary, but I can create article itself and add the picture to it.
When I try to create content anyway (press the button) I get the following message:
error while creating new article content
and of course mysql details - but I am connected to mysql.
Fresh install - phpwcms 1.2.1 dev
I am afraid it's server specific - I have no problem with other server, and no problem with local installation, but for crying out loud - what's the solution???
any ideas?
-------------
I forgot to mension - same thing with phpwcms 1.1-RC4 !!!
-------------
I still have no idea what to do...
It happened after server upgrade... now it's PHP Version 4.3.10 + mysql 4.0.23a


solved!
goddamned php.ini bug, I am going to kill admin
( /usr/lib/php instead of .::/usr/share/pear)
Post Reply