コード例 #1
0
ファイル: utils.php プロジェクト: pauldoo/scratch
/**
    Executes an SQL query that is expected to return just a single row.
*/
function csExecuteSingleRowQuery($dbh, $query)
{
    $result = csExecuteQuery($dbh, $query);
    $row = mysql_fetch_assoc($result) or die("No entry found");
    mysql_fetch_assoc($result) and die("Multiple entries found");
    return $row;
}
コード例 #2
0
ファイル: next.php プロジェクト: pauldoo/scratch
<?php

require_once "c:\\sites_web\\sarah_solwayFed\\admin\\utils.php";
$dbh = csConnect();
$result = csExecuteQuery($dbh, "SELECT * FROM csEvents WHERE date >= CURRENT_DATE() ORDER BY date LIMIT 0,1");
if ($row = mysql_fetch_assoc($result)) {
    $friendlyDate = date('d/m/Y', strtotime($row["date"]));
    ?>
<script src="../Scripts/AC_RunActiveContent.js" type="text/javascript"></script>

    <h1>Next Race</h1>
    <a href="/RaceCalendar/details.php?id=<?php 
    echo htmlspecialchars($row["id"]);
    ?>
"><img src="/includes/thumbnail.php?s=181&path=../<?php 
    echo htmlspecialchars($row["imageFilename"]);
    ?>
" alt="raceImage"/></a>
    <p><?php 
    echo htmlspecialchars($row["details"]);
    ?>
<br/>
    <a href="/RaceCalendar/details.php?id=<?php 
    echo htmlspecialchars($row["id"]);
    ?>
">read more...</a></p>

    <!--
    <div class="race">
    <a href="#"><img src="../<?php 
    echo htmlspecialchars($row["imageFilename"]);
コード例 #3
0
ファイル: index.php プロジェクト: pauldoo/scratch
include "c:\\sites_web\\sarah_solwayFed\\includes\\banner.php";
?>
		</div>
	</div>
	<div id="nav">
		<?php 
include "c:\\sites_web\\sarah_solwayFed\\includes\\navigation.php";
?>
	</div>
	<div id="belowNav">
		<div id="contentArea">
			<div id="leftCol"><!-- InstanceBeginEditable name="EditRegion3" -->
<?php 
require_once "c:\\sites_web\\sarah_solwayFed\\admin\\utils.php";
$dbh = csConnect();
$result = csExecuteQuery($dbh, "SELECT * FROM csEvents ORDER BY date");
?>
    <table>
<?php 
$count = 0;
while ($row = mysql_fetch_assoc($result)) {
    $friendlyDate = date('d/m/Y', strtotime($row["date"]));
    $count++;
    if ($count % 2 == 0) {
        ?>
        <tr class="even">
<?php 
    } else {
        ?>
        <tr>
<?php