include mysql query in variabele
Yannick Bogaert
10/04/2011 19:59:00Hallo allemaal,
ik zou beetje hulp voor volgend probleem.
Volgende code zou ik graag integreren in een
$message variabele voor de mail($to,$subject,$message,$headers)
functie.
Natuurlijk staan er buiten dit stukje code ook
nog andere "plain text" in deze $message.
Iemand een idee hoe ik dit kan integreren?
code is:
<php?
include('connect.php');
$datum = date('d/m/y');
$result = mysql_query("SELECT * FROM irregularity WHERE datum='$datum'");
echo "<table border='1'>
<tr>
<th>Flight</th>
<th>Action</th>
<th>Delay</th>
<th>Reason</th>
<th>Remark</th>
</tr>";
while($row = mysql_fetch_array($result))
{
echo "<tr>";
echo "<td>" . $row['flight'] . "</td>";
echo "<td>" . $row['action'] . "</td>";
echo "<td>" . $row['delay'] . "</td>";
echo "<td>" . $row['reason'] . "</td>";
echo "<td>" . $row['remark'] . "</td>";
echo "</tr>";
}
echo "</table>"
?>
Alvast bedankt!
ik zou beetje hulp voor volgend probleem.
Volgende code zou ik graag integreren in een
$message variabele voor de mail($to,$subject,$message,$headers)
functie.
Natuurlijk staan er buiten dit stukje code ook
nog andere "plain text" in deze $message.
Iemand een idee hoe ik dit kan integreren?
code is:
<php?
include('connect.php');
$datum = date('d/m/y');
$result = mysql_query("SELECT * FROM irregularity WHERE datum='$datum'");
echo "<table border='1'>
<tr>
<th>Flight</th>
<th>Action</th>
<th>Delay</th>
<th>Reason</th>
<th>Remark</th>
</tr>";
while($row = mysql_fetch_array($result))
{
echo "<tr>";
echo "<td>" . $row['flight'] . "</td>";
echo "<td>" . $row['action'] . "</td>";
echo "<td>" . $row['delay'] . "</td>";
echo "<td>" . $row['reason'] . "</td>";
echo "<td>" . $row['remark'] . "</td>";
echo "</tr>";
}
echo "</table>"
?>
Alvast bedankt!
Gewijzigd op 10/04/2011 21:53:26 door Yannick Bogaert
PHP hulp
24/11/2024 11:13:36Sebastiaan Blaas
03/05/2011 14:23:09Code (php)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
<?php
$bla = "<table border='1'>
<tr>
<th>Flight</th>
<th>Action</th>
<th>Delay</th>
<th>Reason</th>
<th>Remark</th>
</tr>";
while($row = mysql_fetch_array($result))
{
$bla .= "<tr>";
$bla .= "<td>" . $row['flight'] . "</td>";
$bla .= "<td>" . $row['action'] . "</td>";
$bla .= "<td>" . $row['delay'] . "</td>";
$bla .= "<td>" . $row['reason'] . "</td>";
$bla .= "<td>" . $row['remark'] . "</td>";
$bla .= "</tr>";
}
$bla .= "</table>"
?>
$bla = "<table border='1'>
<tr>
<th>Flight</th>
<th>Action</th>
<th>Delay</th>
<th>Reason</th>
<th>Remark</th>
</tr>";
while($row = mysql_fetch_array($result))
{
$bla .= "<tr>";
$bla .= "<td>" . $row['flight'] . "</td>";
$bla .= "<td>" . $row['action'] . "</td>";
$bla .= "<td>" . $row['delay'] . "</td>";
$bla .= "<td>" . $row['reason'] . "</td>";
$bla .= "<td>" . $row['remark'] . "</td>";
$bla .= "</tr>";
}
$bla .= "</table>"
?>