Hi guys sorry if my previous questions isn't clear enough, but it came to my senses that my real problem is I can't pass the button click event to execute MYSQL query.
Here is my button that supposed to be when clicked is to execute the query
<form action="invoice.php" method="post">
<input type='submit' name='hehe' />
</form>
Then consider I have established a database connection, here is the code i want to do the trick but it does nothing when the hehe button is clicked
if(isset($_POST['hehe'])){
$result=mysql_query("
SELECT a.id, a.name, s.descc, a.phone, a.start, a.end, a.price
from wp_app_appointments a
LEFT JOIN wp_app_services s
ON a.id=s.id
WHERE a.status ='confirmed'
order by a.name
");
}
Then I want it to display here.
while($test = mysql_fetch_array($result))
{
if (mysql_num_rows($result)!=0)
{
$id = $test['id'];
echo "<tr align='center'>";
/*echo"<td><font color='black'>" .$test['id']."</font></td>";*/
echo"<td style='width:200px'></td>";
echo"<td style='width:500px'>" .$test['name']."</td>";
echo"<td style='width:200px'>". $test['descc']. "</td>";
echo"<td style='width:200px'>". $test['phone']. "</td>";
echo"<td style='width:200px'>". $test['start']. "</td>";
echo"<td style='width:200px'>". $test['end']. "</td>";
echo"<td style='width:200px'>". $test['price']. "</td>";
echo"<td style='width:200px'> <a href ='print.php.?id=$id' target=_blank >Print</a>";
echo"<td style='width:100px'></td>";
echo "</tr>";
}
}
Sorry for the previous questions.