本文整理汇总了PHP中sql_conn函数的典型用法代码示例。如果您正苦于以下问题:PHP sql_conn函数的具体用法?PHP sql_conn怎么用?PHP sql_conn使用的例子?那么, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了sql_conn函数的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: get_info
function get_info($user)
{
$user = mysql_escape_string($user);
$conn = sql_conn();
$query = "SELECT u.Password, u.Nome, u.Cognome\n\t\t\tFROM Utenti u\n\t\t\tWHERE u.Username='{$user}'";
$query = mysql_query($query, $conn) or fail("Query fallita: " . mysql_error($conn));
$db = mysql_fetch_row($query);
return $db;
}
示例2: session_start
<?php
require '../Functions/mysql_fun.php';
require '../Functions/page_builder.php';
require '../Functions/urlLab.php';
session_start();
$absurl = urlbasesito();
if (empty($_SESSION['user'])) {
header("Location: {$absurl}/error.php");
} else {
$id = $_GET['id'];
$id = mysql_escape_string($id);
$conn = sql_conn();
$query = "SELECT f.CodAuto, f.IdFonte, f.Nome, f.Descrizione, f.Time\n\t\t\tFROM Fonti f\n\t\t\tWHERE f.CodAuto='{$id}'";
$req = mysql_query($query, $conn) or fail("Query fallita: " . mysql_error($conn));
$row = mysql_fetch_row($req);
if ($row[0] == $id) {
$title = "Dettaglio Fonte - {$row['1']}";
startpage_builder($title);
echo <<<END
\t\t\t<div id="content">
\t\t\t\t<h2>Dettaglio - {$row['1']}</h2>
\t\t\t\t<dl class="widget">
END;
$heads = array('', 'IdFonte:', 'Nome:', 'Descrizione:');
for ($i = 1; $i < 4; $i++) {
echo <<<END
\t\t\t\t\t<dt class="widget-title">{$heads[$i]}</dt>
END;
示例3: session_start
<?php
session_start();
require 'mysql-db.php';
require 'security.php';
$db = sql_conn();
function preview($text, $max = MAX_LENGTH_PREVIEW, $tail = '...')
{
$tail_len = strlen($tail);
$distance = $max - $tail_len;
if (strlen($text) > $max) {
$temp = substr($text, 0, $distance);
if (substr($text, $distance, 1) == " ") {
$text = $temp;
} else {
$pos = strrpos($temp, " ");
$pos_dist = $distance - $pos;
if ($pos == FALSE || $pos_dist > 40) {
$text = $temp;
} else {
$text = substr($text, 0, $pos);
}
}
$text = $text . $tail;
}
return $text;
}
function validatetextstyle($text, $max = 53)
{
$text2 = wordwrap($text, $max, "<br />", TRUE);
return $text2;
示例4: packageClassiDPTex
function packageClassiDPTex($conn, $riga)
{
$query = "SELECT a.AccessMod, a.Nome, a.Tipo, a.Descrizione\n\t\t\tFROM Attributo a\n\t\t\tWHERE a.Classe='{$riga['0']}'\n\t\t\tORDER BY a.Nome";
$attr = mysql_query($query, $conn) or fail("Query fallita: " . mysql_error($conn));
if ($row_attr = mysql_fetch_row($attr)) {
echo <<<END
\\item \\textbf{Attributi}:
\\begin{itemize}
END;
if ($row_attr[0] == "#") {
echo <<<END
\\item \\nogloxy{\\texttt{\\{$row_attr[0]} {$row_attr[1]}: {$row_attr[2]}}}
END;
} else {
echo <<<END
\\item \\nogloxy{\\texttt{{$row_attr[0]} {$row_attr[1]}: {$row_attr[2]}}}
END;
}
echo <<<END
\\\\ {$row_attr[3]}
END;
while ($row_attr = mysql_fetch_row($attr)) {
if ($row_attr[0] == "#") {
echo <<<END
\\item \\nogloxy{\\texttt{\\{$row_attr[0]} {$row_attr[1]}: {$row_attr[2]}}}
END;
} else {
echo <<<END
\\item \\nogloxy{\\texttt{{$row_attr[0]} {$row_attr[1]}: {$row_attr[2]}}}
END;
}
echo <<<END
\\\\ {$row_attr[3]}
END;
}
echo <<<END
\\end{itemize}
END;
}
$query = "SELECT m.CodAuto, m.AccessMod, m.Nome, m.ReturnType, m.Descrizione\n\t\t\tFROM Metodo m\n\t\t\tWHERE m.Classe='{$riga['0']}'\n\t\t\tORDER BY m.Nome";
$met = mysql_query($query, $conn) or fail("Query fallita: " . mysql_error($conn));
$row_met = mysql_fetch_row($met);
if ($row_met[0] != null) {
echo <<<END
\\item \\textbf{Metodi}:
\\begin{itemize}
END;
if ($row_met[1] == "#") {
echo <<<END
\\item \\nogloxy{\\texttt{\\{$row_met[1]} {$row_met[2]}(
END;
} else {
echo <<<END
\\item \\nogloxy{\\texttt{{$row_met[1]} {$row_met[2]}(
END;
}
$conn = sql_conn();
$query = "SELECT p.Nome, p.Tipo, p.Descrizione\n\t\t\t\tFROM Parametro p\n\t\t\t\tWHERE p.Metodo={$row_met['0']}\n\t\t\t\tORDER BY p.CodAuto";
$par = mysql_query($query, $conn) or fail("Query fallita: " . mysql_error($conn));
$par_desc = mysql_query($query, $conn) or fail("Query fallita: " . mysql_error($conn));
if ($row_par = mysql_fetch_row($par)) {
echo <<<END
{$row_par[0]}: {$row_par[1]}
END;
}
while ($row_par = mysql_fetch_row($par)) {
echo <<<END
, {$row_par[0]}: {$row_par[1]}
END;
}
echo <<<END
)
END;
if ($row_met[3] != null) {
echo <<<END
: {$row_met[3]}
END;
}
echo <<<END
}}
\\\\ {$row_met[4]}
END;
if ($row_desc = mysql_fetch_row($par_desc)) {
echo <<<END
\\\\ \\textbf{Parametri}:
\\begin{itemize}
\\item \\nogloxy{\\texttt{{$row_desc[0]}: {$row_desc[1]}}}
\\\\ {$row_desc[2]}
//.........这里部分代码省略.........
示例5: metriche_metodi
function metriche_metodi($row, $met)
{
$absurl = urlbasesito();
echo <<<END
\t\t\t\t\t\t\t<td><a class="link-color-pers" href="{$absurl}/Classi/Metodi/dettagliometodo.php?id={$row['0']}">{$row['1']}</a>(
END;
$conn = sql_conn();
$query = "SELECT p.CodAuto, p.Nome, p.Tipo\n\t\t\t\t\t\tFROM Parametro p\n\t\t\t\t\t\tWHERE p.Metodo={$row['0']}\n\t\t\t\t\t\tORDER BY p.CodAuto";
$par = mysql_query($query, $conn) or fail("Query fallita: " . mysql_error($conn));
if ($riga = mysql_fetch_row($par)) {
echo <<<END
<a class="link-color-pers" href="{$absurl}/Classi/Metodi/Parametri/dettaglioparametro.php?id={$riga['0']}">{$riga['1']}</a>: {$riga['2']}
END;
}
while ($riga = mysql_fetch_row($par)) {
echo <<<END
, <a class="link-color-pers" href="{$absurl}/Classi/Metodi/Parametri/dettaglioparametro.php?id={$riga['0']}">{$riga['1']}</a>: {$riga['2']}
END;
}
echo <<<END
)</td>
END;
for ($i = 2; $i < 4; $i++) {
if ($row[$i] != null) {
if ($i == 3) {
if ($met == 0) {
echo <<<END
\t\t\t\t\t\t\t<td class="mancante">{$row[$i]}</td>
END;
} elseif ($met == 1) {
echo <<<END
\t\t\t\t\t\t\t<td class="intermedio">{$row[$i]}</td>
END;
} else {
echo <<<END
\t\t\t\t\t\t\t<td class="completato">{$row[$i]}</td>
END;
}
} else {
echo <<<END
\t\t\t\t\t\t\t<td>{$row[$i]}</td>
END;
}
} else {
echo <<<END
\t\t\t\t\t\t\t<td></td>
END;
}
}
}