Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- require_once($_SERVER['DOCUMENT_ROOT'] . '/framework/classes/DBConnection.php');
- define('DB_NAME', 'thename');
- define('DB_HOST', 'thehost.com');
- define('DB_USER', 'user');
- define('DB_PASSWORD', 'pwd');
- // Connect to database
- function db_connect() {
- return DBConnection::GetConnection();
- }
- function getMeta($conn) {
- $sql = "SELECT order_ref FROM orders LIMIT 0,1";
- $stmt = $conn->prepare($sql);
- $stmt->execute();
- $stmt->bind_result($ref);
- $stmt->fetch();
- $stmt->close();
- return $ref;
- }
- function getMeta2($conn, $page) {
- $sql = "SELECT meta FROM pages_meta WHERE pageid = ?";
- $stmt = $conn->prepare($sql);
- $stmt->bind_param('s', $page);
- $stmt->execute();
- $stmt->bind_result($meta);
- $stmt->fetch();
- $stmt->close();
- return $meta;
- }
- $conn = db_connect();
- ?>
- </head>
- <body>
- <h1>Hello World</h1>
- <?php echo getMeta($conn); ?>
- <br>
- <?php echo getMeta2($conn, "homepage"); ?>
- </body>
- </html>
- <?php
- $conn->close();
- ?>
- Hello World
- 1407324725
- Fatal error: Allowed memory size of 209715200 bytes exhausted (tried to allocate 4294967296 bytes) in /home/rnsalarm/co2supermarket.co.uk/test.php on line 41
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement