hi hab ein kleines problem.
undzwar möchte ich das die ausgabe von der sql abfrage live ist ( wie in ner chatbox halt).
die frage ist nun wie ich das anstelle.. kann mir da jemand helfen?
hier ist mal der code der abfrage.
undzwar möchte ich das die ausgabe von der sql abfrage live ist ( wie in ner chatbox halt).
die frage ist nun wie ich das anstelle.. kann mir da jemand helfen?
hier ist mal der code der abfrage.
Code:
<?php
odbc_exec($mssql, 'USE [****]');
if(isset($_POST['ok'])) {
if($_POST['post'] == '') {
echo '<div class="fail">Du musst einen Text eingeben</div>';
} else {
odbc_exec($mssql, 'INSERT INTO [web_shoutbox](username, post, datetime) VALUES(\''.mssql_escape_string($_POST['uname']).'\', \''.mssql_escape_string($_POST['post']).'\', \''.date('d.m.Y H:i:s').'\')');
}
}
$select = odbc_exec($mssql, 'select * from (select top 13 * from [web_shoutbox] order by nid Desc) as a Order by nid ASC');
echo ' <div id="box"></div>
<table id="table" style="width: 700px; height: 200px; background-color:#FFFFFF;" "border-width:thick; padding:5px; border-color:#000000;
border-style:ridge;">
<tr>
<td id="key" style="width:500px;"></td>
<td id="key" style="width:100px;"></td>
<td id="key" style="width:50px;"></td>
</tr>';
while($result = odbc_fetch_array($select)) {
echo '<tr id="did_'.$result['nid'].'" class="row">
<td id="value" style="width:500px;">'.$result['username'].': '.$result['post'].'</td>
<td id="value">'.date('G:i', strtotime($result['datetime'])).'Uhr '.date('d.m.y', strtotime($result['datetime'])).'';
odbc_exec($mssql, 'USE [******]');
$auth = odbc_exec($mssql, 'SELECT Authority FROM [ACCOUNT_TBL] WHERE account=\''.mssql_escape_string($_SESSION['user']).'\'');
if(odbc_result($auth, 'Authority') == 'A' || odbc_result($auth, 'Authority') == 'M') {
echo'<a href="javascript:chat_delete('.$result['nid'].');" title="Delete"><img src="img/delete.png" /></a></td>';
}
echo'</tr>';
}
echo '</table>';
echo '<span id="text"></span>';
echo '<div id="box"></div>';
echo '<form method="post" >
<input type="hidden" name="uname" value="'.$_SESSION['user'].'" />
<table id="table"><center>
<tr>
<td id="key"></td>
<td id="value"><textarea name="post" style="width: 400px; height: 15px;"></textarea></td>
</tr>
<tr>
<td id="key"></td>
<td id="value"><input type="submit" name="ok" value="OK"/></td>
</tr>
</center></table>
</form><br/>';
?>