note 62185 added to ref.sqlite
| From: | Egon at example dot com | Date: | Wed, 22 Feb 2006 01:15:29 +0000 |
| Subject: | note 62185 added to ref.sqlite | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-104184@lists.php.net to get a copy of this message | ||
<$php
public function set_by_db_with_join_to_users_department($col, $foo){
$list = "da.ROWID, da.dept_id, da.script, da.action, da.description, ud.name";
$query = "SELECT $list FROM dept_access AS da, users_department AS ud
WHERE da.dept_id = ud.ROWID
AND da.$col = '$foo';";
$db = new SQLiteDatabase (dept_access::db_path, 0666, &$error)
or die("Failed: $error");
$db->queryExec("ATTACH DATABASE '".dept_access::db_users_path."' AS
users");
$row = $db->arrayQuery($query, SQLITE_ASSOC);
unset($db);
echo $query."\n";
echo var_dump($row);
$this->ROWID = $row[0]['da.ROWID'];
$this->dept_id = $row[0]['da.dept_id'];
$this->dept_name = $row[0]['ud.name'];
$this->script = $row[0]['da.script'];
$this->action = $row[0]['da.action'];
$this->description = $row[0]['da.description'];
}
?>
For ATTACH DATABASE to work you need to run it in a $db->queryExec(ATTACH DATABASE...); before
using $db->arrayQuery. This is most likly the case with other OO methods to. This on stumped me
for a while.
----
Server IP: 216.194.113.175
Probable Submitter: 64.73.76.107
----
Manual Page -- http://www.php.net/manual/en/ref.sqlite.php
Edit -- http://master.php.net/manage/user-notes.php?action=edit+62185
Delete: added to the manual -- http://master.php.net/manage/user-notes.php?action=delete+62185&report=yes&reason=added+to+the+manual
Delete: bad code -- http://master.php.net/manage/user-notes.php?action=delete+62185&report=yes&reason=bad+code
Delete: spam -- http://master.php.net/manage/user-notes.php?action=delete+62185&report=yes&reason=spam
Delete: useless -- http://master.php.net/manage/user-notes.php?action=delete+62185&report=yes&reason=useless
Delete: non-english -- http://master.php.net/manage/user-notes.php?action=delete+62185&report=yes&reason=non-english
Delete: already in docs -- http://master.php.net/manage/user-notes.php?action=delete+62185&report=yes&reason=already+in+docs
Delete: other reasons -- http://master.php.net/manage/user-notes.php?action=delete+62185&report=yes
Reject -- http://master.php.net/manage/user-notes.php?action=reject+62185&report=yes
Search -- http://master.php.net/manage/user-notes.php