File tree Expand file tree Collapse file tree
user_guide_src/source/database Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -514,6 +514,34 @@ public function getDatabase(): string
514514
515515 //--------------------------------------------------------------------
516516
517+ /**
518+ * Set DB Prefix
519+ *
520+ * Set's the DB Prefix to something new without needing to reconnect
521+ *
522+ * @param string $prefix The prefix
523+ *
524+ * @return string
525+ */
526+ public function setPrefix (string $ prefix = '' ): string
527+ {
528+ return $ this ->DBPrefix = $ prefix ;
529+ }
530+
531+ //--------------------------------------------------------------------
532+
533+ /**
534+ * Returns the database prefix.
535+ *
536+ * @return string
537+ */
538+ public function getPrefix (): string
539+ {
540+ return $ this ->DBPrefix ;
541+ }
542+
543+ //--------------------------------------------------------------------
544+
517545 /**
518546 * Returns the last error encountered by this connection.
519547 *
@@ -1329,22 +1357,6 @@ public function prefixTable(string $table = ''): string
13291357
13301358 //--------------------------------------------------------------------
13311359
1332- /**
1333- * Set DB Prefix
1334- *
1335- * Set's the DB Prefix to something new without needing to reconnect
1336- *
1337- * @param string $prefix The prefix
1338- *
1339- * @return string
1340- */
1341- public function setPrefix (string $ prefix = '' ): string
1342- {
1343- return $ this ->DBPrefix = $ prefix ;
1344- }
1345-
1346- //--------------------------------------------------------------------
1347-
13481360 /**
13491361 * Returns the total number of rows affected by this query.
13501362 *
Original file line number Diff line number Diff line change @@ -72,6 +72,10 @@ without needing to create a new connection you can use this method::
7272 $db->setPrefix('newprefix');
7373 $db->prefixTable('tablename'); // outputs newprefix_tablename
7474
75+ You can get the current prefix any time with this method::
76+
77+ $DBPrefix = $db->getPrefix();
78+
7579**********************
7680Protecting identifiers
7781**********************
You can’t perform that action at this time.
0 commit comments