CMS Error in content.php

Issues related to the CMS tools of WYSIWYG Web Builder.
Forum rules
PLEASE READ THE FORUM RULES BEFORE YOU POST:
viewtopic.php?f=12&t=1901

MUST READ:
http://www.wysiwygwebbuilder.com/cms_tools.html
A lot of information about the Content Manager System can be found in the help/manual. Please read this first before posting any questions! Also check out the demo template that is include with the software.

CMS trouble shooting / FAQ:
viewtopic.php?f=10&t=43245
Post Reply
Bucky108
 
 
Posts: 122
Joined: Mon Apr 20, 2020 8:15 pm

CMS Error in content.php

Post by Bucky108 »

I get the following error:

PHP Warning: mysqli_fetch_array() expects parameter 1 to be mysqli_result, boolean given in ...

I have created the 3 tables manually in the MySQL application that I'm using and confirmed they were created successfully.

The error occurs on this line:

while ($data = mysqli_fetch_array($result))

Suggestions?
User avatar
Pablo
 
Posts: 21578
Joined: Sun Mar 28, 2004 12:00 pm
Location: Europe
Contact:

Re: CMS Error in content.php

Post by Pablo »

There may be an error in the table structure.
Bucky108
 
 
Posts: 122
Joined: Mon Apr 20, 2020 8:15 pm

Re: CMS Error in content.php

Post by Bucky108 »

I copied the create scripts from the help page. Do they need to get updated?

CREATE TABLE `CMS_PAGES` (
`id` int(10) unsigned NOT NULL auto_increment,
`category_id` int(11) NOT NULL,
`name` varchar(255) NOT NULL,
`content` text NOT NULL,
`home` tinyint(1) NOT NULL default '0',
`visible` tinyint(1) NOT NULL,
`create_date` timestamp NOT NULL,
`created_by` varchar(255) NOT NULL,
`last_update_date` timestamp NOT NULL default '0000-00-00 00:00:00',
`last_update_by` varchar(255) NOT NULL,
`views` int(11) NOT NULL,
`menu_index` smallint(4) NOT NULL,
`url` varchar(255) NULL,
`extra_data` varchar(255) NULL,
`title` VARCHAR(100),
`description` VARCHAR(255),
`keywords` VARCHAR(255),
`seo_friendly_url` VARCHAR(100),
PRIMARY KEY (`id`));

CREATE TABLE `CMS_SEARCH_WORDMATCH` (
`page_id` int(10) unsigned NOT NULL,
`word_id` int(10) unsigned NOT NULL,
PRIMARY KEY (`page_id`,`word_id`));

CREATE TABLE `CMS_SEARCH_WORDS` (
`id` int(10) unsigned NOT NULL auto_increment,
`word` varchar(50) NOT NULL,
PRIMARY KEY (`id`)) ;
User avatar
Pablo
 
Posts: 21578
Joined: Sun Mar 28, 2004 12:00 pm
Location: Europe
Contact:

Re: CMS Error in content.php

Post by Pablo »

The table structure is ok.
But did you use the correct MySQL settings?
Bucky108
 
 
Posts: 122
Joined: Mon Apr 20, 2020 8:15 pm

Re: CMS Error in content.php

Post by Bucky108 »

Pablo I found the problem causing the error:

$sql = "SELECT id, parent_id, name, url FROM " . $mysql_table . "PAGES WHERE visible = 1 ORDER BY menu_index ASC";

There was no "parent_id" column in the table, created from the SQL as I listed it above.

When I added the column manually in the table it removed the error.

But now when I click on "Administrator" I cant add any records.

Is there something else that has to be done?
User avatar
Pablo
 
Posts: 21578
Joined: Sun Mar 28, 2004 12:00 pm
Location: Europe
Contact:

Re: CMS Error in content.php

Post by Pablo »

Is there another error?
Bucky108
 
 
Posts: 122
Joined: Mon Apr 20, 2020 8:15 pm

Re: CMS Error in content.php

Post by Bucky108 »

No other error it just shows:

The CMS Admin object allows you to add, edit or remove pages online.

And nothing else.
User avatar
Pablo
 
Posts: 21578
Joined: Sun Mar 28, 2004 12:00 pm
Location: Europe
Contact:

Re: CMS Error in content.php

Post by Pablo »

What happens if you add a page?
Are there any error in the server log?
Bucky108
 
 
Posts: 122
Joined: Mon Apr 20, 2020 8:15 pm

Re: CMS Error in content.php

Post by Bucky108 »

I added a page and re-published the site. No change.

No errors on server log.
Bucky108
 
 
Posts: 122
Joined: Mon Apr 20, 2020 8:15 pm

Re: CMS Error in content.php

Post by Bucky108 »

By the way here is the web server configuration:

Web server
Microsoft-IIS/10.0
Database client version: libmysql - mysqlnd 5.0.12-dev - 20150407 - $Id: 3591daad22de08524295e1bd073aceeff11e6579 $
PHP extension: mysqli Documentation curl Documentation mbstring Documentation
PHP version: 7.2.26
User avatar
Pablo
 
Posts: 21578
Joined: Sun Mar 28, 2004 12:00 pm
Location: Europe
Contact:

Re: CMS Error in content.php

Post by Pablo »

Did you enable PHP error reporting on the server?
If it does not work then there should be at least be a message about by it fails.
Bucky108
 
 
Posts: 122
Joined: Mon Apr 20, 2020 8:15 pm

Re: CMS Error in content.php

Post by Bucky108 »

I'm using a hosting service and I don't see anywhere where you can capture PHP errors.

However I created my own error handler:
-------------------------------------------------
//error handler function
function customError($errno, $errstr) {
echo "<b>Error:</b> [$errno] $errstr";
}

//set error handler
set_error_handler("customError");
-------------------------------------------------

No errors reported. I created a copy of the page and forced an error, which the handler did pick up.

So I'm pretty sure there were no MySQL or PHP errors. In any case there is a lot of error checking in the script.

Is there a working sample of the demo so I can see what the screens look like when it is working correctly?
Bucky108
 
 
Posts: 122
Joined: Mon Apr 20, 2020 8:15 pm

Re: CMS Error in content.php

Post by Bucky108 »

Pablo I found the problem. I had PHP set to 7 on the content page but not on the admin page.

Sorry for the run around I should have checked that right off the bat.
Bucky108
 
 
Posts: 122
Joined: Mon Apr 20, 2020 8:15 pm

Re: CMS Error in content.php

Post by Bucky108 »

Next problem: I added a new page and clicked "Save" but the new page was not created. I added write permissions on the folder.

Should the name field have an extension, i.e. "test.htm"?

What is the format for the External URL field?

Should the Owner field be the name of the site admin?
User avatar
Pablo
 
Posts: 21578
Joined: Sun Mar 28, 2004 12:00 pm
Location: Europe
Contact:

Re: CMS Error in content.php

Post by Pablo »

Pages are not saved to a folder. The content is are stored in the database. All content is accessed from one page (with a CMS view).

Here is a related tutorial:
http://wysiwygwebbuilder.com/cms_tools.html
Bucky108
 
 
Posts: 122
Joined: Mon Apr 20, 2020 8:15 pm

Re: CMS Error in content.php

Post by Bucky108 »

OK thanks..got it working.
Post Reply