私はPHPに非常に慣れていないので、これはばかげた質問かもしれませんが、私のウェブサイトは現在インクルードに分割されており、データベース接続を確立できましたが、「about」ページのコンテンツをSQLから取得したいと思いますデータベースであり、静的 HTML ではありません。私の質問は、データベースからコンテンツを取得し、関連するタグに表示するために実際に PHP を作成するにはどうすればよいですか?
サイトへのリンクは次のとおりです: http://midway-media.net/3/about.php
これは現時点での私のコードです:
<?php include_once "includes/scripts.php"; ?>
<?php include_once "includes/header.php";?>
<?php
$db_host = "localhost";
$db_user = "root";
$db_pass = "";
$db_name = "camelhorse";
$db_error_one= "<h1>Could not connect to database</h1>";
$db_error_two= "<h1>Database 'camelhorse' is not available</h1>";
@mysql_connect ($db_host,$db_user,$db_pass) or die ($db_error_one);
@mysql_select_db("$db_name") or die ("$db_error_two");
?>
<img id="logo_full_name" src="images/camelhorst_logo_full.png" alt="Camelhorse Creative Studio">
<article>
<img src="images/long_line_single_column.png" style="margin:10px auto 0px auto;">
<h1>ABOUT OUR COMPANY</h1>
<p>Camelhorse is a Creative Agency is multi disciplinary creative partner, specializing in Brand Development and with sub divisions in web development, communication design and photography. We provide effective solutions for various marketing and communication requirements.<br><br>
Companies today are looking for creative partners that will supply them with tangible results, ensuring their brand or products succeed against their competition in this tough and competitive economic environment. We offer clients the edge in their respective industries, by truly understanding their brand through extensive market related research, and strategically positioning their brand or products correctly in the market. We are able to make brands and products stand out from the clutter and help them reach consumers in the most effect way.<br><br>
Camelhorse Creative Agency offers a complete solution from conceptualization of an idea to production, and supplying a finished product to our clients when it comes to Brand Development, Brand Activation, Point-of-Sale, Digital Implementation, Tactical and Strategic development. Contact us today and let see what we can do for your brand.</p>
<img src="images/three_column_grid_line.png" alt="line">
<h2>MISSION</h2>
<p>Camelhorse’s mission is to provide the best creative service in the industry is a fun and humoristic way we approach business seriously and aspire to be the most creative and dynamic media house with one stop in house services for all your branding needs.</p>
<h2>VISION</h2>
<p>We see ourselves a industry leading creative agency in the near future offering the most contemporary designs and development techniques. We aspire to this daily with a dedicated team.</p>
</article>
<?php include_once "includes/footer.php";?>