Results 1 to 2 of 2

Thread: storing content in MySQL database

  1. #1
    Join Date
    May 2007
    Location
    England, UK
    Posts
    235
    Thanks
    3
    Thanked 6 Times in 6 Posts

    Question storing content in MySQL database

    I'm new to MySQL and PHP.

    Is it a good Idea to store content within a MySQL database?
    Is it search engine friendly?

    for example I have created some news pages that call data from a database.
    essencially they are just static html pages with some php.

    My thinking behind doing it this way is that I can create a search box to search all the content on my website.

    e.g.

    PHP Code:
    <?php     
            mysql_connect
    ("mydomain.com""username""password") or die(mysql_error()); 
            
    mysql_select_db("databasename") or die(mysql_error());
    ?>
        
            
            <?php
            $data 
    mysql_query("SELECT * FROM mytable WHERE id='news1'") or die(mysql_error());
            while(
    $info mysql_fetch_array$data )) 
                { 
                print 
    "<span class=\"newsheading1\">" $info['title'] . "</span><br /><br />";
                print 
    $info['content'];         
                }
    ?>

  2. #2
    Join Date
    Jul 2006
    Location
    just north of Boston, MA
    Posts
    1,806
    Thanks
    13
    Thanked 72 Times in 72 Posts

    Default

    Is it a good Idea to store content within a MySQL database?
    yes

    Is it search engine friendly?
    define search engine friendly... if you are asking if you implement a search engine will it work? that all depends on how you design and implement.
    as for whether its viable for outside search engines eg (google, yahoo ...) yes it is very much adaptable to those as well.

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •