3
I try the following code in a block but get no output, what am I missing? Got any sample code???
global $xoopsDB;
mysql_pconnect('localhost', 'douglas', '') or die ("Can't connect to DB");
mysql_query("USE customers");
<table cellpadding=4 border=1><tr><td>id</td><td>userid</td><td>Last</td><td>first</td><td>phone</td><td>ip
</td><td>comment</td></tr>
<?php
$query = "SELECT id,userid,last,first,phone,ip,comment FROM cdata where userid like '%doug%'";
$result = mysql_query($query);
while ($data = mysql_fetch_object($result)) {
echo "<tr>
<td>$data->id</td>
<td>$data->userid</td>
<td>$data->last</td>
<td>$data->first</td>
<td>$data->phone</td>
<td>$data->ip</td>
<td>$data->comment</td>
</tr>";
}
}
?>
</table>
</body></html>