Jump to content

AdamTwyx

New Members
  • Posts

    4
  • Joined

  • Last visited

AdamTwyx's Achievements

Newbie

Newbie (1/5)

0

Reputation

  1. Thats great guys, Appreciate the help / Pointers / Guidance. Its good to hear peoples opinions on how or why things should be done a certain way.
  2. Ah I see what you guys mean now. When I was first starting out, I had the aid of a programmer who said that he always put the Connection details into a header.php as that will always be included, thus cutting down on the amount of code having to be written on each page. I wont lie but I have used Google (other search engines are available ) and I will admit that most of the time in the examples shown, the connection details are entered separately as opposed to in a header file. Fortunately, the project I am working on is still in its early days so refactoring will not be an issue at all. Out of Interest, Is there a 'Best Practice' you stick to when it comes to DB Connections etc?
  3. Like I said, I am a noob and slowly mucking my way through this project I have based on a lot of Self Taught Code... Given what you said, Would the code be like this? <?php $req = mysql_query('select * FROM Venues WHERE id="' . $_GET["id"] . '" '); while($dnn = mysql_fetch_array($req)) { ?> <?php $pageTitle = " | PoolHQ"; include("../includes/header.php"); ?> <div class="container"> etc etc If thats the case, how can I call the 'Name' into the Page title?
  4. Hello All, Can someone explain something to me (Im a Noob) I am currently trying to set a page title to be based on the result of a query on that page but not having much joy and I am too inexperienced to know where I am going wrong. let me try and explain where I am at with this starting with the code for the page in question... <?php $pageTitle = " | PoolHQ"; include("../includes/header.php"); ?> <div class="container"> <?php $req = mysql_query('select * FROM Venues WHERE id="' . $_GET["id"] . '" '); while($dnn = mysql_fetch_array($req)) { ?> <div class="row" id="features"> <div class="col-sm-12 feature" style="background-color:transparent"> <br /> All of the DB connection details are in the header.php file along with this <title><?php echo $pageTitle; ?></title> therefore I usually set the page title to whatever I want but in the case above, I would like the page title to be the 'Name' which is a field from the 'Venues' Table. The query is on that page now as the rest of the page (which I did not post details for) uses the information in the page. If I move the query to the top of the page, I get basically a blank page apart from the footer.php. Can someone give me an idea as to why its not owrking and what i should do...?
×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.