javascript - Fetch records from table -


i working on chat app. stored msg db, not fetch , show admin msg send in reply person after person 1 send msg admin.

$email = $_get["q"];      if($email== "admin@gmail.com")      {          $sql = "select *, date_format(chatdate,'%d-%m-%y %r') cdt chat order username , id";      $sql = "select * (" . $sql . ") ch order id";      $result = mysql_query($sql) or die('query failed: ' . mysql_error());       // update row information      $msg="<table border='0' style='font-size: 10pt; color: blue; font-family: verdana, arial;'>";      while ($line = mysql_fetch_array($result, mysql_assoc))      {            $msg = $msg . "<tr><td>" . $line["cdt"] . "&nbsp;</td>" .                 "<td>" . $line["username"] . ":&nbsp;</td>" .                 "<td>" . $line["msg"] . "</td></tr>";      }      $msg=$msg . "</table>";       echo $msg; 

you can apply multiple order by in filed using comma

so instead of

order username , id 

use

 order username,id 

also stop using mysql deprecated. can use mysqli or pdo


Comments

Popular posts from this blog

c# - Binding a comma separated list to a List<int> in asp.net web api -

Delphi 7 and decode UTF-8 base64 -

html - Is there any way to exclude a single element from the style? (Bootstrap) -