Php 我如何将一行作为一个类进行回音?
我如何将一行作为一个类进行回音 我试图将一个类与一个引导图标相呼应,我尝试了所有方法,但似乎无法让它工作 我希望我的脚本将MySQL中的smiley类添加到一个类中。根据搜索插入悲伤/快乐的微笑 我附上了MySQL的截图 my MySQL的屏幕截图:Php 我如何将一行作为一个类进行回音?,php,mysql,sql,twitter-bootstrap,Php,Mysql,Sql,Twitter Bootstrap,我如何将一行作为一个类进行回音 我试图将一个类与一个引导图标相呼应,我尝试了所有方法,但似乎无法让它工作 我希望我的脚本将MySQL中的smiley类添加到一个类中。根据搜索插入悲伤/快乐的微笑 我附上了MySQL的截图 my MySQL的屏幕截图: 在echo语句中尝试此代码//假设您已在$row['smiley'中提取了smiley数据 echo '<p> <b>'.$row['navn'].'</b> **My smiley here** Kalorie
在echo语句中尝试此代码//假设您已在$row['smiley'中提取了smiley数据
echo '<p> <b>'.$row['navn'].'</b> **My smiley here** Kalorier: '.$row['kalorier'].' Fedt: '.$row['fedt'].' Kulhydrater: '.$row['kul'].' Protein: '.$row['protein'].' <i class=\"'.$row['smiley'].'\"></i></p>' ;
这将帮助您找到内联注释
include_once ('mad-forbind.php');
if(isset($_GET['mad']))
{
$mad = trim($_GET['mad']) ;
$mad = mysqli_real_escape_string($dbc, $mad);
$query = "select navn,kalorier,fedt, kul, protein, smiley from vare where navn like '%$mad%' or kalorier like '%$mad%'";
//echo $query;
$result = mysqli_query($dbc,$query);
if($result)
{
if(mysqli_affected_rows($dbc)!=0)
{
//create table here
$table = '<table>';
$table .= '<tr>';
$table .= '<th>navn</th>';
$table .= '<th>kalorier</th>';
$table .= '<th>kul</th>';
$table .= '<th>fedt</th>';
$table .= '<th>protein</th>';
$table .= '<th>smiley</th>';
$table .= '</tr>';
while($row = mysqli_fetch_array($result,MYSQLI_ASSOC))
{
$table .= '<tr>';
$table .= '<td>'.$row['navn'].'</td>';
$table .= '<td>'.$row['kalorier'].'</td>';
$table .= '<td>'.$row['kul'].'</td>';
$table .= '<td>'.$row['fedt'].'</td>';
$table .= '<td>'.$row['protein'].'</td>';
$table .= '<td>'.$row['smiley'].'</td>';
$table .= '</tr>';
}
$table .= '</table>';
//display the table here
echo $table;
}
else
{
echo 'Vi kunne desværre ikke finde:"'.$_GET['mad'].'"';
}
}
}
else
{
echo 'Parameter Missing';
}
要将这些字体添加到存储在数据库中的某些类中的html代码在哪里?
include_once ('mad-forbind.php');
if(isset($_GET['mad']))
{
$mad = trim($_GET['mad']) ;
$mad = mysqli_real_escape_string($dbc, $mad);
$query = "select navn,kalorier,fedt, kul, protein, smiley from vare where navn like '%$mad%' or kalorier like '%$mad%'";
//echo $query;
$result = mysqli_query($dbc,$query);
if($result)
{
if(mysqli_affected_rows($dbc)!=0)
{
//create table here
$table = '<table>';
$table .= '<tr>';
$table .= '<th>navn</th>';
$table .= '<th>kalorier</th>';
$table .= '<th>kul</th>';
$table .= '<th>fedt</th>';
$table .= '<th>protein</th>';
$table .= '<th>smiley</th>';
$table .= '</tr>';
while($row = mysqli_fetch_array($result,MYSQLI_ASSOC))
{
$table .= '<tr>';
$table .= '<td>'.$row['navn'].'</td>';
$table .= '<td>'.$row['kalorier'].'</td>';
$table .= '<td>'.$row['kul'].'</td>';
$table .= '<td>'.$row['fedt'].'</td>';
$table .= '<td>'.$row['protein'].'</td>';
$table .= '<td>'.$row['smiley'].'</td>';
$table .= '</tr>';
}
$table .= '</table>';
//display the table here
echo $table;
}
else
{
echo 'Vi kunne desværre ikke finde:"'.$_GET['mad'].'"';
}
}
}
else
{
echo 'Parameter Missing';
}
$a = "color: red";
echo "<html><head><style>
p.intro {
".$a."
}
</style></head>
<body><p class='intro'>aaaaaaaaaaaaa</p></body></html>";