本文整理匯總了PHP中DB_select函數的典型用法代碼示例。如果您正苦於以下問題:PHP DB_select函數的具體用法?PHP DB_select怎麽用?PHP DB_select使用的例子?那麽, 這裏精選的函數代碼示例或許可以為您提供幫助。
在下文中一共展示了DB_select函數的10個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。
示例1: display_search_form
}
// Begin to process the page...
$iSearchString = $_POST['iSearchString'];
if (empty($_POST['iSearchType'])) {
if (empty($_GET['searchType'])) {
$iObjectType = "user";
} else {
$iObjectType = $_GET['searchType'];
}
} else {
$iObjectType = $_POST['iSearchType'];
}
?>
<h2>Search for objects</h2>
<?php
/*echo "\$_POST['iSearchString']=".$_POST['iSearchString']."\n<br />";
echo "\$_POST['iSearchType']=".$_POST['iSearchType']."\n<br />";
echo "\$_GET['searchType']=".$_GET['searchType']."\n<br />";
echo "\$iSearchString=$iSearchString\n<br />";
echo "\$iObjectType=$iObjectType\n<br />";*/
?>
<h3>Help</h3>
<p>Some help...</p>
<?php
display_search_form($iObjectType, $iSearchString);
if (!empty($_POST['iSearchString'])) {
echo " <h3>Results</h3>\n";
DB_connect($DB_host, $DB_login, $DB_pass);
DB_select($DB_db);
display_results($iSearchString, $iObjectType);
}
示例2: Text_alter
echo "<td><a class=\"vzkaz\" href=\"./vzkazy_vedeni.php?kod=$kod&id_vzkazu=".$zaz["id_vzkazu"]."\">".$zaz["predmet"]."</a></td>";
echo "<td><a class=\"vzkaz\" href=\"./vzkazy_vedeni.php?kod=$kod&id_vzkazu=".$zaz["id_vzkazu"]."\">".$zaz["jmeno"]." ".$zaz["prijmeni"]."</a></td>";
echo "<td><a class=\"vzkaz\" href=\"./vzkazy_vedeni.php?kod=$kod&id_vzkazu=".$zaz["id_vzkazu"]."\">(".$zaz["skupina"].")</a></td>";
echo "<td><a class=\"vzkaz\" href=\"./vzkazy_vedeni.php?kod=$kod&id_vzkazu=".$zaz["id_vzkazu"]."\">".Datum($zaz["datum"])."</a></td>";
echo "</tr>";
$i++;
}
echo "</table>";
}
else echo Text_alter("","Nemáte ¾ádné zprávy.");
}
else
{
$SQL = "select * from vzkazy v, skupiny s, ucitele u
where v.id = '$id_vzkazu' and s.id = v.id_skup_odesilatel and u.login = v.login_uc";
if(DB_select($SQL, $vystup, $pocet))
{
echo "<table>";
echo "<tr><td><a href=\"./vzkazy_vedeni.php?kod=$kod\"><img src=\"./images/sipka.gif\" border=none></a></td></tr>";
if($zaz = MySQL_fetch_array($vystup))
{
echo "<TR><td colspan=2> </td></tr>";
echo "<tr><td width=\"150\"><b>Odesílatel:</b></td><td>".$zaz["jmeno"]." ".$zaz["prijmeni"].", ".$zaz["skupina"]."</td></tr>";
echo "<tr><td width=\"150\"><b>Pro tøídy/skupiny:</b></td><td>".Text_alter($zaz["trida"], "neuvedeno")."</td></tr>";
echo "<tr><td width=\"150\"><b>Pøedmìt:</b></td><td>".Text_alter($zaz["predmet"], "neuvedeno")."</td></tr>";
echo "<tr><td colspan=2> </td></tr><tr><td colspan=2><i>".Text_alter($zaz["text"], "zpráva neobsahuje ¾ádný text")."</i></td></tr></table>";
echo "<P>";
}
}
}
Konec();
示例3: VypisZam
function VypisZam($SQL)
{
global $kod;
if(DB_select($SQL, $vystup, $pocet))
{
while($zaznam=MySQL_fetch_array($vystup))
{
echo "<tr class=\"tabulka\" id=\"tabulka\" onMouseOver=\"styl();\" onMouseOut=\"styl();\">";
echo " <td width=\"30%\"> </td>";
echo " <td width=\"60\"><input type=\"checkbox\" name=smaz[] value=\"".$zaznam["login"]."\"> ".$zaznam["zkratka"]."</td>";
echo "<td>".Sestav_jmeno($zaznam["titul_pred"], $zaznam["jmeno"], $zaznam["prijmeni"],$zaznam["titul_za"]);
echo "</td></tr>";
}
}
}
示例4: Hlaska
{
echo Hlaska("<li>Komise s touto zkratkou u¾ v databázi existuje.<br>Zvolte jinou zkratku, nebo nejdøíve pùvodní akci odstraòte.</li>","komise nebyla ulo¾ena do databáze","");
}
else
{
$SQL = "insert into komise (zkratka, nazev) values ('$zkratka', '$nazev')";
DB_exec($SQL);
}
}
}
}
$SQL = "select * from komise where zkratka<>'aaa' order by zkratka";
if(DB_select($SQL, $vystup, $pocet))
{
$SQL2 = "select k.zkratka from komise k, vzkazy v where k.zkratka=v.komise and (v.platnost_do>=Now() or v.platnost_do='0000-00-00' or v.platnost_do is null) order by k.zkratka";
if(DB_select($SQL2, $vystup2, $pocet2))
{
while($zaznam=mysql_fetch_array($vystup2)) $pouzite_komise[] = $zaznam["zkratka"];
}
echo "<form action=\"admin_data.php?kod=$kod&vyber=$vyber\" method=\"post\">";
echo "<table border=0 cellspacing=2 cellpadding=5><tr>";
echo "<td colspan=\"5\">Zkratka: <input type=\"text\" value=\"$zkratka\" name=\"zkratka\">";
echo " Název: <input type=\"text\" value=\"$nazev\" name=\"nazev\"></td></tr>";
echo "<tr><td colspan=\"4\"><input type=\"submit\" name=\"odeslano_new\" value=\"pøidat komisi\"></td></tr>";
echo "</form>";
echo "<tr><td> </td></tr>";
echo "<form action=\"admin_data.php?kod=$kod&vyber=$vyber\" method=\"post\">
<tr bgcolor=\"#dddddd\" align=\"center\">
<td><b><center>mazání</center></b></td>
<td><center><b>zkratka</b></center></td>
<td><center><b>název</b></center></td></tr>";
示例5: Uloz_uziv
function Uloz_uziv($login, $fullname, $id_skup, $prava, &$kod)
{ global $REMOTE_ADDR;
$log = "log_uloz.txt";
VytvorLog($log);
srand((double)microtime()*1e6);
$kod = "$login|$id_skup|".rand();
ZapisDoLogu($log, "kod=$kod");
$cas = date("Y-m-d H:i:s");
/*$SQL = "delete from prihl_uziv where ip='$REMOTE_ADDR' and kod<>'$kod' ";
DB_exec($SQL);*/
$SQL = "select count(*) pocet from prihl_uziv where login_uc = '$login'";
DB_select($SQL, $vystup, $zaznamu);
$zaznam = MySQL_fetch_array($vystup);
if ($zaznam["pocet"]==0)
{
$SQL = "insert into prihl_uziv(kod, ip, fullname, cas, login_uc, skupina, prava) values
('$kod', '$REMOTE_ADDR', '$fullname', '$cas', '$login', '$id_skup', '$prava')";
}
else
{
$SQL = "update prihl_uziv set kod='$kod', ip='$REMOTE_ADDR', fullname='$fullname',
cas='$cas', skupina='$id_skup' where login_uc='$login' ";
}
DB_exec($SQL);
$cas = time()+3600*24*365;
/*echo "kod = $kod";
echo "cas = $cas";*/
}
示例6: Tel
function Tel()
{
$SQL = "select hodnota from pomocna where klic='tel'";
if(DB_select($SQL, $vyst,$poc))
if($zaz=mysql_fetch_array($vyst)) return $zaz["hodnota"];
}
示例7: VypisZam
function VypisZam($SQL)
{
global $kod;
if(DB_select($SQL, $vystup, $pocet))
{
while($zaznam=MySQL_fetch_array($vystup))
{
$aktivni_text = "";
if($zaznam["aktivni"]=="0") $aktivni_text = " (doèasnì na ¹kole nepracuje)";
echo "<tr class=\"tabulka\" id=\"tabulka\" onMouseOver=\"styl();\" onMouseOut=\"styl();\"><td width=\"30%\"> </td><td width=\"50\"><a class=\"seznam_black\" href=\"./ucitele.php?kod=$kod&ucitel=".$zaznam["login"]."\">".$zaznam["zkratka"]."</a></td><td>
<a class=\"seznam\" href=\"./ucitele_udaje_admin.php?kod=$kod&ucitel=".$zaznam["login"]."\">".
Sestav_jmeno($zaznam["titul_pred"], $zaznam["jmeno"],
$zaznam["prijmeni"],$zaznam["titul_za"])."</a></td><TD>".Text_alter("", $aktivni_text)."</TD></tr>";
}
}
}
示例8: include
<? include ("./include/unit.php");
if(Prihlasen($kod, $REMOTE_ADDR, $skupina, $fullname, $login, $chyba))
{
NoCACHE();
Hlavicka("Zvonìní", $fullname, $kod);
$SQL = "select * from zvoneni order by hodina";
if(DB_select($SQL, $vyst, $poc))
{
echo "<center><table border=0 bgcolor=\"#efefef\" cellspacing=\"10\" class=\"zvoneni\">";
while($zaz=mysql_fetch_array($vyst))
{
echo "<tr><td align=\"right\"><b>".$zaz["hodina"]."</b></td>";
echo "<td align=\"right\">".Cas($zaz["od"])."</td>";
echo "<td align=\"center\"> - </td>";
echo "<td align=\"right\">".Cas($zaz["do"])."</td></tr>";
}
echo "</table></center>";
}
Konec();
}
?>
示例9: max
else
{
$SQL = "select k.*, max(kp.datum_akce) platnost_do, min(kp.datum_akce) platnost_od, k.cas_od cas_od, k.cas_do cas_do
from kalendar k, kalendar_prubeh kp
where k.i = '1' and
kp.id_akce = k.id and
kp.datum_akce>=DATE_ADD(Now(), INTERVAL 2 DAY) and
k.zkratky like '%$zkratka%' and
k.login_uc = '$login'
group by kp.id_akce
order by k.datum";
if(DB_select($SQL, $vyst, $poc))
{
$SQL = "select id from kalendar where DATE_ADD(datum, INTERVAL 2 DAY)>=Now() and i='1'";
if(DB_select($SQL, $vystup, $pocet)) while($zaznam = mysql_fetch_array($vystup)) $id[] = $zaznam["id"];
echo "<form action=\"./plan_uc_send.php?kod=$kod&vyber=$vyber\" method=post enctype=\"multipart/form-data\">";
echo "<table border=\"0\" cellpadding=\"5\" cellspacing=\"0\">";
echo "<tr bgcolor=\"#ddddee\"><td></td><td><center>datum akce</center></td><td><center>informace</center></td><td><center>datum ¾ádosti</center></td></tr>";
echo "<tr><td colspan=\"4\" heigh=\"0\"></td></tr>";
$barva = "bgcolor=\"#e0e0e0\"";
$b = 0;
while($zaz=mysql_fetch_array($vyst))
{
$platnost_od = $zaz["platnost_od"];
$platnost_do = $zaz["platnost_do"];
$cas_od = Cas($zaz["cas_od"]);
$cas_do = Cas($zaz["cas_do"]);
$hod_od = $zaz["hod_od"];
$hod_do = $zaz["hod_do"];
$barva_text="black";
示例10: DB_select
echo "<form action=\"./soubory_send.php?kod=$kod\" method=post enctype=\"multipart/form-data\"><table>";
echo "<tr><td colspan=3><b><".c_font.">Skupiny u¾ivatelù, kterým je soubor urèen (roèník):</font></b>";
echo "<br><font color=gray><small>- zvolíte-li <i>uèitel</i>, soubor se zobrazí i øediteli, zástupcùm a administrátorùm";
echo "<br>- jednotlivé skupiny mají pøednost pøed volbou <i>v¹ichni</i> i <i>v¹ichni studenti</i>";
echo "<br>- podobnì <i>v¹ichni studenti</i> má pøednost pøed volbou <i>v¹ichni</i>";
echo "<br>- nezvolíte-li ¾ádnou skupinu, bude soubor viditelný v¹em</li></small></font></td></tr>";
$SQL = "select * from skupiny where id<100 order by id";
DB_select($SQL, $vystup, $pocet);
$i=0;
while($zaznam = MySQL_fetch_array($vystup))
{
$skup[$i] = new Cskupina($zaznam["id"], $zaznam["skupina"]);
$i++;
}
$SQL = "select count(*) pocet from skupiny where id<20";
if(DB_select($SQL, $vystup, $pocet)) $zaznam = MySQL_fetch_array($vystup);
$zaklad = $zaznam["pocet"]-2;
echo "<tr><td><br><input type=\"checkbox\" name=\"vsichni[]\" value=\"".$skup[0]->id."\">".$skup[0]->skupina;
echo "<br><input type=\"checkbox\" name=\"vsichni_studenti[]\" value=\"".$skup[1]->id."\">".$skup[1]->skupina."</td></tr>";
echo "<tr><td colspan=3><hr></td></tr>";
echo "<tr><td valign=\"top\">";
for($i=2; $i<count($skup); $i++)
{
if((($i-2)%$zaklad)==0 and $i<>2)
{
echo "</td><td valign=\"top\">";
echo "<input type=\"checkbox\" name=\"prijemce[]\" value=\"".$skup[$i]->id."\">".$skup[$i]->skupina;
}
else if($i==2) echo "<input type=\"checkbox\" name=\"prijemce[]\" value=\"".$skup[$i]->id."\">".$skup[$i]->skupina;
else echo "<br><input type=\"checkbox\" name=\"prijemce[]\" value=\"".$skup[$i]->id."\">".$skup[$i]->skupina;
}