WebsiteBaker Support (2.8.x) > Templates, Menus & Design

Using SQL in 2.8.3

<< < (2/2)

Ruud:
I actually was wrong about the local scope. The database class is available for use.

This small test should run fine:

--- Code: ---<?php /* open tag used for code detection in the forum */

$query = $database->query("SELECT `page_title` from ".TABLE_PREFIX."pages where `page_id`='1' ") ;
if($query && $query->numRows() == 1) {
  $row = $query->fetchRow();
  echo $row['page_title'];
} else {
  echo "no data";
}

--- End code ---

richwingerter:
Excellent! That was just what I needed. Once I had the right code to access a table, I was able to access my tables and get data from them. Thanks a bunch!

Navigation

[0] Message Index

[*] Previous page

Go to full version