[code=php]<?php
$page = new page();
$page->random_banner(‘Connections/dbConn.php’);
$page->Display_Section_One();
?>
[code=php]<?
function random_banner($path= ”)
{
require($path);
$id = rand(1,11);
mysql_select_db($database_dbConn, $dbConn);
$query = “SELECT banner_id, image, url, alt, short_comment, long_comment, author, company
FROM rss_banner
WHERE banner_id = $id”;
$result = mysql_query($query) or die(mysql_error());
$row = mysql_fetch_assoc($result);
$totalRows = mysql_num_rows($result);
return $row;
?>
Im trying to pass a string variable which is the location of the database connection from a page into the random_banner function. I then want to pass this through to the require() function however is comes up with an error. The string vlaue is passed through as if i do an echo of $path it produces the string value however the require() function wont recognise it. Any ideas?