Hello, I have a problem with mysql query.
I am just trying to display a simple table with telephone numbers from database.
I paste above code into code section and It doesn't work. I get white screen with no errors or anything.
<?php
$sql = mysql_connect('192.168.1.160', 'dir', 'l94Qq72')
or die('Cannot connect to mysql server: ' . mysql_error());
mysql_select_db('asterisk') or die(mysql_error());
$result123 = mysql_query("SELECT extension,name,directdid FROM users WHERE extension >= 630 AND extension < 680 ORDER BY extension") or die(mysql_error());
echo "<br />";
echo "<span style=\"border-bottom: 1px dashed;\"><strong>WJ Parking</strong></span><br />";
echo "<br />";
echo "<table onMouseover=\"changeto(event, '#E2DBCB')\" onMouseout=\"changeback(event, '#F3F0E9')\" border=\"0\" class=\"texts\" width=\"540\"/>";
echo "<tr id=\"ignore\" bgcolor=\"#E2DBCB\"><td width=\"20%\"><b>Extension</b></td><td width=\"50%\"><b>Name</b></td><td width=\"30%\"><b>Direct Dial</b></td></tr>";
while($wiersz=mysql_fetch_array ($result123)) {
echo "<tr bgcolor=\"#F3F0E9\">
<td width=\"20%\">".$wiersz['extension']."</td>
<td width=\"50%\">".$wiersz['name']."</td>
<td width=\"30%\">".$wiersz['directdid']."</td>
</tr>";
}
echo "</table>";
mysql_close($sql);
?>
Do you know if it's possible to use mysql queries in code section?
If not what is the best way to do mysql queries in website baker.
Regards,
Mike