当前位置: 首页>>代码示例>>PHP>>正文


PHP sqlError函数代码示例

本文整理汇总了PHP中sqlError函数的典型用法代码示例。如果您正苦于以下问题:PHP sqlError函数的具体用法?PHP sqlError怎么用?PHP sqlError使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。


在下文中一共展示了sqlError函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: getType

 public static function getType($name)
 {
     $query = "select type from structured_field_value_label where label='{$name}'";
     $result = mysql_query($query) or die(sqlError(__FILE__, __LINE__, $query));
     $row = mysql_fetch_row($result);
     return $row[0];
 }
开发者ID:standup75,项目名称:standupweb-cms,代码行数:7,代码来源:StructuredFieldValue.php

示例2: initAssets

 public static function initAssets($unitId, $id)
 {
     $query = "select label from structured_field_asset_label where unit_id={$unitId}";
     $result = mysql_query($query) or die(sqlError(__FILE__, __LINE__, $query));
     while ($row = mysql_fetch_row($result)) {
         $query = "INSERT INTO structured_field_asset (structured_field_id, label) VALUES ({$id}, '" . $row[0] . "')";
         $result2 = mysql_query($query) or die(sqlError(__FILE__, __LINE__, $query));
     }
 }
开发者ID:standup75,项目名称:standupweb-cms,代码行数:9,代码来源:StructuredFieldAsset.php

示例3: getSettings

 public static function getSettings()
 {
     $query = "select * from settings";
     $result = mysql_query($query) or die(sqlError(__FILE__, __LINE__, $query));
     $i = 0;
     while ($row = mysql_fetch_row($result)) {
         $setting[$i++] = $row;
     }
     return $setting;
 }
开发者ID:standup75,项目名称:standupweb-cms,代码行数:10,代码来源:Setting.php

示例4: getStructure

 public static function getStructure()
 {
     $query = "SHOW COLUMNS FROM structured_field_value_label";
     $result = mysql_query($query) or die(sqlError(__FILE__, __LINE__, $query));
     while ($row = mysql_fetch_row($result)) {
         $columnNames[] = $row[0];
     }
     // we remove the last element (rank) and the 2 first elements (id, unitId)
     return array_slice($columnNames, 2, sizeOf($columnNames) - 3);
 }
开发者ID:standup75,项目名称:standupweb-cms,代码行数:10,代码来源:StructuredFieldValueLabel.php

示例5: ScheduleEventGet

function ScheduleEventGet($EventID)
{
    $schedList = array();
    global $EventSchedulesTable;
    $result = $db->query("select   RoomID,\n                                       StartTime\n                              from     {$EventSchedulesTable}\n                              where    EventID = {$EventID}\n                              order by RoomID, StartTime\n                              ") or die("Unable to get schedule information for event: " . sqlError());
    while ($row = $result->fetch(PDO::FETCH_ASSOC)) {
        $schedList[TimeToStr($row['StartTime'])] = getRoomName(isset($row['RoomID']) ? $row['RoomID'] : "No Room");
    }
    return $schedList;
}
开发者ID:poetimp,项目名称:ltcsw,代码行数:10,代码来源:AdminEventSchedules.php

示例6: getPasswordForUser

function getPasswordForUser($user)
{
    connect();
    $query = "select * from user where username='{$user}'";
    $query = stripslashes($query);
    $result = mysql_query($query) or die(sqlError(__FILE__, __LINE__, $query));
    if (!empty($result)) {
        $userrow = mysql_fetch_row($result);
        return $userrow[2];
    }
    return "";
}
开发者ID:standup75,项目名称:standupweb-cms,代码行数:12,代码来源:authenticate.php

示例7: setViewUrl

 public static function setViewUrl($name, $url)
 {
     $query = "select * from view_url where name='{$name}'";
     $result = mysql_query($query) or die(sqlError(__FILE__, __LINE__, $query));
     if ($row = mysql_fetch_row($result)) {
         $query = "UPDATE view_url SET url='{$url}' WHERE name='{$name}';";
         $result = mysql_query($query) or die(sqlError(__FILE__, __LINE__, $query));
     } else {
         $query = "INSERT INTO view_url (name, url) VALUES ('{$name}', '{$url}')";
         $result = mysql_query($query) or die(sqlError(__FILE__, __LINE__, $query));
     }
     return $row;
 }
开发者ID:standup75,项目名称:standupweb-cms,代码行数:13,代码来源:ViewUrl.php

示例8: selectRoom

function selectRoom($SchedID)
{
    //-----------------------------------------------------------------------------
    // Retrieve a list of all avaliable rooms
    //-----------------------------------------------------------------------------
    $roomList = getRoomList();
    global $ScheduleTable;
    global $EventID;
    //-----------------------------------------------------------------------------
    // Check to see if scheduled event has room assigned
    //-----------------------------------------------------------------------------
    $roomKey = substr($SchedID, 0, 3) . '%';
    $result = $db->query("select RoomID\n                             from   {$ScheduleTable}\n                             where  SchedID like '{$roomKey}'\n                             and    EventID = {$EventID}\n                            ") or die("Unable to get room ID: " . sqlError());
    $row = $result->fetch(PDO::FETCH_ASSOC);
    if (!empty($row)) {
        $roomIDList = explode(',', $row['RoomID']);
    } else {
        $roomIDList = array(0);
    }
    //-----------------------------------------------------------------------------
    // Set Row background Color
    //-----------------------------------------------------------------------------
    $hour = substr($SchedID, 1, 2);
    if ($hour % 2 == 0) {
        $bgcolor = "#6699FF";
    } else {
        $bgcolor = "#D9D9FF";
    }
    //-----------------------------------------------------------------------------
    // Print the selection Drop-Down
    //-----------------------------------------------------------------------------
    $fieldName = 'Room_' . substr($SchedID, 0, 3) . '[]';
    print "<td bgcolor=\"{$bgcolor}\" align=\"center\">";
    print "<select multiple size=\"4\" name=\"{$fieldName}\">";
    foreach ($roomList as $roomNum => $roomName) {
        if (in_array($roomNum, $roomIDList)) {
            print "<option selected value=\"{$roomNum}\">{$roomName}</option>";
        }
    }
    foreach ($roomList as $roomNum => $roomName) {
        if (!in_array($roomNum, $roomIDList)) {
            print "<option value=\"{$roomNum}\">{$roomName}</option>";
        }
    }
    print "</select>";
    print "</td>";
}
开发者ID:poetimp,项目名称:ltcsw,代码行数:47,代码来源:ScheduleEvent.php

示例9: date_format

            <input type=hidden name=ChurchID <?php 
    print "value={$ChurchID}";
    ?>
>
            <table border=1 width=100%>
               <tr>
                  <td colspan=4 bgcolor=#000000 align=center><font color=#FFFF00>History</font></td>
               </tr>
               <tr>
                  <td bgcolor=#000000><font color=#FFFF00>Date</font></td>
                  <td bgcolor=#000000><font color=#FFFF00>Type</font></td>
                  <td bgcolor=#000000><font color=#FFFF00>Amount</font></td>
                  <td bgcolor=#000000><font color=#FFFF00>Annotation</font></td>
               </tr>
               <?php 
    $result = $db->query("select date_format(Date,'%m-%d-%y') as Date,\n                                             Amount,\n                                             Annotation\n                                      from   {$MoneyTable}\n                                      where  ChurchID={$ChurchID}\n                                      ") or die("Unable to get accounting history: " . sqlError());
    while ($row = $result->fetch(PDO::FETCH_ASSOC)) {
        $Date = $row['Date'];
        $Amount = $row['Amount'];
        $Annotation = $row['Annotation'];
        if ($Amount < 0) {
            $Type = "Credit";
            $Amount *= -1;
        } else {
            if ($Amount > 0) {
                $Type = "Refund";
            } else {
                $Type = "--";
            }
        }
        print "<tr>";
开发者ID:poetimp,项目名称:ltcsw,代码行数:31,代码来源:AdminMoney.php

示例10: header

<?php

//----------------------------------------------------------------------------
// This software is licensed under the MIT license. Use as you wish but give
// and take credit where due.
//
// Author: Paul Lemmons
//----------------------------------------------------------------------------
include 'include/RegFunctions.php';
if ($Admin != 'Y') {
    header("refresh: 0; URL=Admin.php");
    die;
    // JudgeID, JudgingCatagory, substr(StartTime,1,1) Day, substr(StartTime,2) StartTime, StopTime
}
$filename = "JudgesPreferences-" . date("m-d-Y") . ".csv";
header("Content-disposition: attachment; filename={$filename}");
header("Content-type: application/octet-stream");
$fp = fopen('php://output', 'w');
$results = $db->query("select  e.JudgeID,\n                                  e.JudgingCatagory,\n                                  Case\n                                     when substring(s.StartTime,1,1) = '1' then 'Sunday'\n                                     when substring(s.StartTime,1,1) = '2' then 'Monday'\n                                     when substring(s.StartTime,1,1) = '3' then 'Tuesday'\n                                     when substring(s.StartTime,1,1) = '4' then 'Wednesday'\n                                     when substring(s.StartTime,1,1) = '5' then 'Thursday'\n                                     when substring(s.StartTime,1,1) = '6' then 'Friday'\n                                     when substring(s.StartTime,1,1) = '7' then 'Saturday'\n                                     else                                'Unknown'\n                                  End\n                                  Day,\n                                  maketime(substring(s.StartTime,2,2),substring(s.StartTime,4,2),'00') EventStartTime,\n                                  maketime(substring(s.EndTime,2,2)  ,substring(s.EndTime,4,2)  ,'00') EventStopTime\n                         from     {$JudgeEventsTable}   e,\n                                  {$JudgeTimesTable}    t,\n                                  {$EventScheduleTable} s\n                         where    t.JudgeID = e.JudgeID\n                         and      s.SchedID = t.SchedID\n                         order by JudgeID") or die("Unable to get Judge Preference list:" . sqlError());
$rowCount = 0;
while ($row = $results->fetch(PDO::FETCH_ASSOC)) {
    if ($rowCount++ == 0) {
        foreach ($row as $key => $value) {
            $heading[] = $key;
        }
        fputcsv($fp, $heading);
    }
    fputcsv($fp, $row);
}
fclose($fp);
开发者ID:poetimp,项目名称:ltcsw,代码行数:30,代码来源:DataJudgePref.php

示例11: die

                     </font>
                  </span>
               </td>

               <td align="left" bgcolor="#000000">
                  <span style="background-color: #000000">
                     <font color="#FFFF00">
                        Event Name
                     </font>
                  </span>
               </td>
            </tr>
         <?php 
$ChurchTeams = $db->query("SELECT E.EventName,\n                                            E.EventID,\n                                            E.MaxSize,\n                                            E.MinSize,\n                                            T.TeamID\n                                     FROM   {$EventsTable} E,\n                                            {$TeamsTable}  T\n                                     WHERE  E.EventID  = T.EventID\n                                     AND    T.ChurchID = {$ChurchID}") or die("Unable to retrieve Team List:" . sqlError());
while ($row = $ChurchTeams->fetch(PDO::FETCH_ASSOC)) {
    $cntResult = $db->query("select count(*) as count\n                                      from   {$TeamMembersTable}\n                                      where  TeamID = " . $row['TeamID']) or die("Can not determine team count:" . sqlError());
    $cntRow = $cntResult->fetch(PDO::FETCH_ASSOC);
    $numMembers = $cntRow['count'];
    ?>
            <tr>
               <td width="70" align="center">[<a href="AdminTeamEvents.php?Action=View<?php 
    print "&TeamID=" . $row['TeamID'] . "&EventID=" . $row['EventID'];
    ?>
">View</a>]</td>
               <td width="70" align="center">[<a href="AdminTeamEvents.php?Action=Update<?php 
    print "&TeamID=" . $row['TeamID'] . "&EventID=" . $row['EventID'];
    ?>
">Update</a>]</td>
               <td width="70" align="center"> [<a href="DelTeam.php?<?php 
    print "&TeamID=" . $row['TeamID'];
    ?>
开发者ID:poetimp,项目名称:ltcsw,代码行数:31,代码来源:SignupTeamEvents.php

示例12: ereg_replace

        $Email = "None";
    }
    if ($ErrorMsg == "") {
        ereg_replace("'", "''", $FirstName);
        ereg_replace("'", "''", $LastName);
        ereg_replace("'", "''", $Address);
        ereg_replace("'", "''", $City);
        ereg_replace("'", "''", $Zip);
        ereg_replace("'", "''", $Phone);
        ereg_replace("'", "''", $Email);
        if ($mode == 'update') {
            $sql = "update {$JudgesTable}\n                    set FirstName      = '{$FirstName}',\n                        LastName       = '{$LastName}',\n                        Address        = '{$Address}',\n                        City           = '{$City}',\n                        State          = '{$State}',\n                        Zip            = '{$Zip}',\n                        Email          = '{$Email}',\n                        Phone          = '{$Phone}'\n                  where JudgeId        =  {$JudgeID}\n                  and   ChurchId       =  {$ChurchID}";
        } else {
            $sql = "insert into {$JudgesTable}\n                        (FirstName   ,\n                         LastName    ,\n                         Address     ,\n                         City        ,\n                         State       ,\n                         Zip         ,\n                         Email       ,\n                         Phone       ,\n                         ChurchID)\n                 values ('{$FirstName}',\n                         '{$LastName}' ,\n                         '{$Address}'  ,\n                         '{$City}'     ,\n                         '{$State}'    ,\n                         '{$Zip}'      ,\n                         '{$Email}'    ,\n                         '{$Phone}'    ,\n                         {$ChurchID})";
        }
        $results = $db->query($sql) or die("Unable to process update: " . sqlError());
        if ($mode != 'update') {
            $JudgeID = $db->lastInsertId();
        }
        ?>
         <body style="background-color: rgb(217, 217, 255);">
         <?php 
        if ($mode == 'update') {
            ?>
                  <h1 align=center>
                     Judge <br>"<?php 
            print $LastName . ", " . $FirstName;
            ?>
"<br>Updated!
                  </h1>
                <?php 
开发者ID:poetimp,项目名称:ltcsw,代码行数:31,代码来源:AdminJudges.php

示例13: die

}
?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html lang="en">

    <head>
       <title>
          Seniors
       </title>
    </head>

    <body bgcolor="White">
    <h1 align="center">All Seniors</h1>
    <hr>
    <?php 
$results = $db->query("select   p.ParticipantID,\n                                          p.FirstName,\n                                          p.LastName,\n                                          p.Email,\n                                          p.Phone,\n                                          p.Grade,\n                                          p.Comments,\n                                          p.Address,\n                                          p.City,\n                                          p.State,\n                                          p.Zip,\n                                          c.ChurchName\n                                 from     {$ParticipantsTable} p,\n                                          {$ChurchesTable}     c\n                                 where    p.ChurchID = c.ChurchID\n                                 and      p.Grade    = 12\n                                 order by LastName,\n                                          FirstName") or die("Not found:" . sqlError());
$first = 1;
?>
         <table border="1" width="100%">
         <?php 
while ($row = $results->fetch(PDO::FETCH_ASSOC)) {
    $ParticipantID = $row['ParticipantID'];
    $eventTypeCount = EventCounts($ParticipantID);
    $eventCount = $eventTypeCount['Team'] + $eventTypeCount['Solo'];
    if ($eventCount > 0) {
        $Name = $row['LastName'] . ", " . $row['FirstName'];
        $Email = $row['Email'];
        $Phone = $row['Phone'];
        $Grade = $row['Grade'];
        $Comment = $row['Comments'];
        $Address = $row['Address'];
开发者ID:poetimp,项目名称:ltcsw,代码行数:31,代码来源:RptSeniors.php

示例14: rgb

//----------------------------------------------------------------------------
include 'include/RegFunctions.php';
?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html lang="en">

<head>
<meta http-equiv="Content-Language" content="en-us">
<title>Assign Individual Events</title>

</head>

<body style="background-color: rgb(217, 217, 255);">
<h1 align="center">Assign Individual Events</h1>
      <?php 
$results = $db->query("select FirstName,\n                                        LastName,\n                                        ParticipantID,\n                                        Grade\n                                 from   {$ParticipantsTable}\n                                 where  ChurchID = {$ChurchID}\n                                 order  by LastName\n                                ") or die("Can not get Participant List:" . sqlError());
$count = 0;
?>
         <table border="1" width="100%">
            <tr>
               <td width="70" align=center bgcolor="#000000"><font color="#FFFF00">Team</font></td>
               <td width="70" align=center bgcolor="#000000"><font color="#FFFF00">Individual</font></td>
               <td width="70" align=center bgcolor="#000000"><font color="#FFFF00">Grade</font></td>
               <td width="70" align=center bgcolor="#000000"><font color="#FFFF00">ID Number</font></td>
               <td align="left" bgcolor="#000000"><font color="#FFFF00">Participant</font></td>
            </tr>
         <?php 
while ($row = $results->fetch(PDO::FETCH_ASSOC)) {
    $ParticipantID = $row['ParticipantID'];
    $EventCounts = EventCounts($ParticipantID);
    $TeamEvents = $EventCounts['Team'];
开发者ID:poetimp,项目名称:ltcsw,代码行数:31,代码来源:SignupSoloEvents.php

示例15: concat

        print $EventName;
        ?>
</b></TD>
               <TD width="25%" bgcolor="#C0C0C0"><b><?php 
        print $PatricipantName;
        ?>
</b></TD>
               <TD width="15%" bgcolor="#C0C0C0"><b><?php 
        print $Award;
        ?>
</b></TD>
               <tr>

            <?php 
        if ($TeamEvent) {
            $memberList = $db->query("select concat(p.FirstName,' ',p.LastName) MemberName,\n                                                    IFNULL(m.Award,'Not Assigned') Award\n                                             from   {$ParticipantsTable} p,\n                                                    {$TeamMembersTable}  m\n                                             where  m.TeamID        = {$ParticipantID}\n                                             and    p.ParticipantID = m.ParticipantID\n                                             order by p.LastName\n                                            ") or die("Unable to get event Team Member list:" . sqlError());
            while ($row = $memberList->fetch(PDO::FETCH_ASSOC)) {
                $MemberName = $row['MemberName'];
                ?>
                     <tr>
                        <td></td>
                        <td><?php 
                print $MemberName;
                ?>
</td>
                        <?php 
                if ($IndividualAwards) {
                    $Award = $row['Award'];
                    ?>
                           <td><?php 
                    print $Award;
开发者ID:poetimp,项目名称:ltcsw,代码行数:31,代码来源:TallyPrintAwards.php


注:本文中的sqlError函数示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。