Forum Moderators: coopster
[size=4][/size]<?php
$dbcon = mysqli_connect('servername', 'username', '', 'dbname');
$sqlget = "SELECT * FROM userdata";
$result = mysqli_query($dbcon, $sqlget) or die('error getting');
$image = "vbm1.png";
echo "<img src=".$image." Style=width:350px;height:100px;>";
echo "<table>";
echo "<tr><th>name</th><th>email</th><th>phone</th><th>city</th><th>subject</th><th>message</th><tr>";
while($row = mysqli_fetch_array($result, MYSQLI_ASSOC)){
echo "<tr><td>";
echo $row['name'];
echo "</td><td>";
echo $row['email'];
echo "</td><td>";
echo $row['phone'];
echo "</td><td>";
echo $row['city'];
echo "</td><td>";
echo $row['subject'];
echo "</td><td>";
echo $row['message'];
echo "</td></tr>";
}
echo"</table>";
?>
<?php
$dbcon = mysqli_connect('servername', 'username', '', 'dbname');
$sqlget = "SELECT * FROM userdata";
$result = mysqli_query($dbcon, $sqlget) or die('error getting');
$image = "vbm1.png";
echo "<img src=".$image." style=width:350px;height:100px;><table><tr><th>name</th><th>email</th><th>phone</th><th>city</th><th>subject</th><th>message</th><tr>";
while($row = mysqli_fetch_array($result, MYSQLI_ASSOC)){
echo "<tr>
<td>$row['name']</td>
<td>$row['email']</td>
<td>$row['phone'];</td>
<td>$row['city'];</td>
<td>$row['subject'];</td>
<td>$row['message'];</td>
</td></tr>";
}
echo "</table>";
?> <?php
$var = "cruel";
// #1
echo "hello ";
echo $var;
echo " world";
// #2
echo "hello " . $var . " world";
// #3
echo "hello $var world";
// This won't work
echo 'hello $var world';
?> Also, note that <th> is not supported in HTML5. Instead, you could use <tbody> and <thead>.
...you must add a <tbody> of <thead>/<tfooter> around every <tr>
<?php
$myVar = 'Hello World';
echo <<<EOD
<script>
alert($myVar);
</script>
EOD;
?>
<?php
include('code/connect.php');
include('code/filter.php');
$key = strip_tags($_GET['key']);
$kv = mres($key);
$gw = 'gword';
$ew = 'eword';
$top = 'topic';
$com = 'comments';
$ex1 = 'ex1';
$ex2 = 'ex2';
$sql = 'SELECT * FROM `words` WHERE `key` = \''.$kv.'\'';
$query = $sql;
$result = mysql_query($query);
$rows = mysql_num_rows($result);
if($result) {
for($i = 0; $i < $rows; $i++) {
$f1[$i] = mysql_result($result,$i,$gw);
$f2[$i] = mysql_result($result,$i,$ew);
$f3[$i] = mysql_result($result,$i,$com);
$f4[$i] = mysql_result($result,$i,$ex1);
$f5[$i] = mysql_result($result,$i,$ex2);
$h[$i] = '<p class="one">' . $f1[$i] . ' >> ' . $f2[$i] . ' " ' . $f3[$i] . ' " ' . $f4[$i] . ' " ' . $f5[$i] . '</p>';
echo $h[$i];
}
}
?>