本文整理汇总了PHP中CDatabase::executeQuery方法的典型用法代码示例。如果您正苦于以下问题:PHP CDatabase::executeQuery方法的具体用法?PHP CDatabase::executeQuery怎么用?PHP CDatabase::executeQuery使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类CDatabase
的用法示例。
在下文中一共展示了CDatabase::executeQuery方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: CDatabase
<?php
$title = 'Template for testprogram';
include 'header.php';
include 'class/CDatabase.php';
?>
<div id='content'>
<?php
$db = new CDatabase();
if (isset($_GET['animal'])) {
$type = $_GET['animal'];
$res = $db->executeQuery("SELECT * FROM animal WHERE id='{$type}'");
?>
<h1 class="animalName"><?php
echo utf8_encode($res[0]['name']);
?>
</h1>
<img id="slider" src="images/<?php
echo $res[0]['image'];
?>
Front1.jpg" atr="<?php
echo utf8_encode($res[0]['animalName']);
?>
" width="300" height="360" class="animalFront">
<div id="menu">
<p class="buttonInfo" id="infoBtn">Info</p>
<p class="buttonLive" id="liveBtn">Bor</p>
<p class="buttonEat" id="eatBtn">Äter</p>
<p class="buttonExtra" id="extraBtn">Extra</p>
</div>
<img id="playText" src="images/speakerOff.png" atr="Högtalare" width="30" height="30" style="margin: 10px">
示例2: CDatabase
<?php
$title = 'Template for testprogram';
include 'header.php';
include 'class/CDatabase.php';
$db = new CDatabase();
$res = $db->executeQuery('SELECT animal.id, animal.name from animal');
?>
<div id='content'>
<div id='animalList'>
<h1>Klicka på ett djur</h1>
<i>Tips.. håll musen över varje bild för att höra hur dom låter</i>
<form method="GET">
<?php
foreach ($res as $key => $value) {
?>
<a href="play.php?animal=<?php
echo $res[$key]['id'];
?>
" name="<?php
echo $res[$key]['id'];
?>
"><img id="<?php
echo $res[$key]['id'];
?>
" class="animal" src="images/<?php
echo $res[$key]['id'];
?>
Sign.jpg"
atr="<?php
echo $res[$key]['name'];