Forum Moderators: coopster
This is not the code but will work for what I need:
<?php
$host="localhost"; // Host name
$username="#*$!x_test"; // Mysql username
$password="#*$!x"; // Mysql password
$db_name="#*$!x_#*$!"; // Database name
$tbl_name="#*$!x_#*$!"; // Table name
// Connect to server and select database.
mysql_connect("$host", "$username", "$password")or die("cannot connect");
mysql_select_db("$db_name")or die("cannot select DB");
// Retrieve data from database
$sql="SELECT * FROM $tbl_name";
$result=mysql_query($sql);
// Start looping rows in mysql database.
while($rows=mysql_fetch_array($result)){
?>
<table width="400" border="1" cellspacing="0" cellpadding="3">
<tr>
<td width="10%"><? echo $rows['id'];?></td>
<td width="30%"><? echo $rows['name'];?></td>
<td width="30%"><? echo $rows['lastname'];?></td>
<td width="30%"><? echo $rows['email'];?></td>
</tr>
</table>
<?
// close while loop
}
// close connection
mysql_close();
?>
The only way I have been able to make this information appear in a html page is by creating the code and saving as a .php file and then insertig it into the page via; SSI. The part of the code that I need to show on the html page has been bolded in the code above.
<!--#include virtual="/#*$!xx.php" -->
There has got to be a simple way to do this and I hate being so dumb on this issue, but I've never had to do this before.
If anyone has info on this, pleasssse help.
[webmasterworld.com...]
In this case you will be able to insert php directly inside html page