Question regarding info populated from database

Discussion in 'MySQL' started by dartdesign, Apr 18, 2007.

  1. #1
    Hello,

    I have some problems with a client website which uses a CMS and database. My problem is that when i try to updated the pages and put meta tags they do not appear.

    The main page uses a database and all other sub pages are populated from a php file called content. The biggest part of the content in pages is taken from database. My problem is that i dont know how to put a page titles, because everything is take from the database and content php page. May be i will need a string and additional table in database.

    Here is an example from content.php file

    <?php
    include "mysqlconnect.php";
    $lid=$_GET['lid'];
    if(isset($lid))
    {

    $result=mysql_query("select * from mainlinks where lid=$lid");
    $row=mysql_fetch_array($result);
    $title=$row['linkname'];
    $contents=$row['contents'];
    }

    if($title=="HOME")
    {
    header("location: index.php");
    }
    $result1=mysql_query("select * from mainlinks order by orderno");

    ?>
    <HTML>
    <HEAD>
    <TITLE>finesh finish:: <?php echo $title;?></TITLE>

    and this is an example of MySQL database:


    INSERT INTO `contents` VALUES ('HOME', NULL, '<P dir=ltr><SPAN style="COLOR: #ffffff">Traditional French Polishing &amp; Decorating Contractors</SPAN></P>');
    INSERT INTO `contents` VALUES ('PAINTING AND DECORATING', NULL, NULL);
    INSERT INTO `contents` VALUES ('FRENCH POLISHING', NULL, NULL);
    INSERT INTO `contents` VALUES ('COMMERCIAL WORK', NULL, NULL);
    INSERT INTO `contents` VALUES ('PORTFOLIO', NULL, '<DIV align=center><SPAN style="COLOR: #ffa500; FONT-FAMILY: Arial Black">This Page is Under Construction</SPAN></DIV>');
    INSERT INTO `contents` VALUES ('FAQs', NULL, NULL);
    INSERT INTO `contents` VALUES ('TESTIMONIALS', NULL, NULL);

    Where and how to make this if it is possible ?

    King Regards,
    Kaloyan Banev.
     
    dartdesign, Apr 18, 2007 IP
  2. sparksflying

    sparksflying Peon

    Messages:
    1,066
    Likes Received:
    50
    Best Answers:
    0
    Trophy Points:
    0
    #2
    Hi ,

    are you saying that $Title doesnt get populated..

    Does this code work..

    
    if($title=="HOME")
    {
    header("location: index.php");
    }
    
    
    Code (markup):
    Dont know if im missing something but can you show us the mainlinks table also? How is mainlinks related to contents?

    Is it not just a matter of pulling the first value from the contents ?

    Sorry If im unclear ... Id like to help out :)

    Cheers
     
    sparksflying, Apr 27, 2007 IP
  3. Pat Gael

    Pat Gael Banned

    Messages:
    1,331
    Likes Received:
    68
    Best Answers:
    0
    Trophy Points:
    0
    #3
    Another common cause is when a cms has different include files.

    Depending ont the coding, it might require calling mysqlconnect.php more than once for the included content.
     
    Pat Gael, Apr 27, 2007 IP