The Arcive of Official vBulletin Modifications Site.It is not a VB3 engine, just a parsed copy! |
|
#1
|
||||
|
||||
Custom Page will not render after adding database connection
I have some custom pages that I have moved the variables from the .php file into a database.
I've tested the database connection on its own and everything works fine. But as soon as I add the database code to the vB custom page the page no longer renders (just shows a blank page). Here is a sample of the database code I've tried to insert into the custom page: Code:
// Get parameters from url query string $db = new dbPDO(); $cruiseport_id = !empty($_GET['id'])?intval($_GET['id']):1; // get all the values form your table limited to the first matching row (thre should only be one $query = "SELECT * FROM cruiseports WHERE cruiseport_id = :cruiseportid limit 1"; // the prepare and bind methods prevent any sort of SQL injection (ie bad stuff in the $id value) $stmt = $db->prepare($query); $stmt->bindValue(":cruiseportid",$cruiseport_id); $stmt->execute(); // we are only expecting 1 row here... $port = $stmt->fetch(PDO::FETCH_ASSOC); |
|
|
X vBulletin 3.8.12 by vBS Debug Information | |
---|---|
|
|
More Information | |
Template Usage:
Phrase Groups Available:
|
Included Files:
Hooks Called:
|