However, for some reason I can't work out how to add a simple piece of PhP code to the 'GLOBAL ELEMENTS' -->Navigation End' element (or any other element to be honest).
My code is simple - it looks like this ..
QUOTE
<?php
/* set's the variables for MySQL connection */
$server = "localhost";
$username = "********"; // removed for obvious reasons
$password = "*****"; // removed for obvious reasons
/* Connects to the MySQL server */
$link = @mysql_connect ($server, $username, $password)
or die (mysql_error());
/* Defines the Active Database for the Connection */
if (!@mysql_select_db("kdalton_sales", $link)) {
echo "<p>There has been an error. This is the error message:</p>";
echo "<p><strong>" . mysql_error() . "</strong></p>";
echo "Please Contact Your Systems Administrator with the details";
}
/* Passes a Query to the Active Database */
$result = mysql_query("SELECT * FROM minerals", $link);
if (!$result) {
echo("<p>Error performing query: " . mysql_error() . "</p>");
exit();
}
/* Closes Connection to the MySQL server */
mysql_close ($link);
?>
/* set's the variables for MySQL connection */
$server = "localhost";
$username = "********"; // removed for obvious reasons
$password = "*****"; // removed for obvious reasons
/* Connects to the MySQL server */
$link = @mysql_connect ($server, $username, $password)
or die (mysql_error());
/* Defines the Active Database for the Connection */
if (!@mysql_select_db("kdalton_sales", $link)) {
echo "<p>There has been an error. This is the error message:</p>";
echo "<p><strong>" . mysql_error() . "</strong></p>";
echo "Please Contact Your Systems Administrator with the details";
}
/* Passes a Query to the Active Database */
$result = mysql_query("SELECT * FROM minerals", $link);
if (!$result) {
echo("<p>Error performing query: " . mysql_error() . "</p>");
exit();
}
/* Closes Connection to the MySQL server */
mysql_close ($link);
?>
This piece of code works fine as a PhP page on its own and is being used in other parts of the site - so I know it works. However, it will not work when embedded into an IPB element. I have even tried to use an 'include' command where this code sits in a seperate PhP file - but that doesn't work either.
1 million ISK to anyone who can solve this