Skip to content

Blog::save

James Cobban edited this page Dec 8, 2019 · 1 revision

$blog->save($xml)

Up: class Blog

This method updates the record contents in the database server. If previously detected errors have been accumulated in $this‑>msg this method suppresses the update, generates a warning that includes the text of the messages to explain why the record was not updated, and returns 0. If $blog‑>isExisting() is false this inserts a new record into the table. If $blog->isExisting() is true the existing database record is updated. This method extends the base implementation by setting the field 'bl_datetime' to the current date.

parameter description
$xml If the value is boolean true then a representation of the SQL command issued to update the database is printed on the output enclosed in an XML <cmd> tag. If the value is a string then the representation of the SQL command issued to update the database is printed on the output enclosed in an XML <$xml> tag. If the leading characters of the string contain spaces these are extracted and used as an indentation value before the tag and end-tag. If there are any characters after a valid XML tag name these are extracted and presented only in the opening tag. Otherwise no output is generated.

For example if the text is to be displayed as part of a web page then you may set the parameter to 'p' or " p class='cssclassname'".

The method returns boolean false if the method was unable to update the database, 1 if the method updated the database record, or 0 if the database did not need to be updated because there were no changes to the record.

The method throws an Exception if user is not authorized to update the database.

Next: class Census

Clone this wiki locally