Chat room (you are
chatting with)
EXECUTE_DML ($sql);} Get the information and assemble the data back to the client (chat room) function getMessage ($getter, $sender) {$sql = "select * from message where getter= ' $getter ' and Sender= ' $sender ' and isget=0 '; $sqlHelper =new sqlHelper (); $array = $sqlHelper->execute_dql2 ($sql); $messageInfo = "
For
($i =0; $i < count ($array), $i + +) {$row = $array [$i]; $messageInfo. = "
{$row [' id ']}
{$row [' Sende R ']}
{$row [' Getter '}}
{$row [' content ']}
{$row [' sendtime ']
} ";} $messageInfo. = "
"; File_put_contents (" D:/test.txt ", $messageInfo." \ r \ n ", file_append); $sqlHelper->close_connect (); return $messageInfo;}}
GetMessage ($getter, $sender),//file_put_contents ("D:/test.txt", "news--". $mesList. " \ r \ n ", file_append); Echo $mesList;? >
Why in the first paragraph of the function GetMessage ()
var cons=mesres.getelementsbytagname ("Con");
Alert is 0. There are records added to the database
I'm looking at the PHP video of Hanshunping.
Ask the great God to rescue
Reply to discussion (solution)
In IE, getelementsbyname () is taken by ID, but in other browsers, it is normally taken by the name attribute, so if your code runs on a non-ie browser, there will be no value.
Sorry, I didn't notice that you wrote getElementsByTagName () you should change to getElementById ()
var Cons=mesres.getelementbyid ("Con");
var Sendtimes=mesres.getelementbyid ("Sendtime");
Besides, you've got a lot of low-level mistakes.
$ (' mycons '). value+= " to say:" +cons[i].childnodes[0].nodevalue+ "" +sendtimes[i].childnodes[0].nodevalue;
PHP code is not executed by the client browser, and you get cons, Sendtimes are just a DOM object, not a result set
Sorry, I didn't notice that you wrote getElementsByTagName () you should change to getElementById ()
var Cons=mesres.getelementbyid ("Con");
var Sendtimes=mesres.getelementbyid ("Sendtime");
Besides, you've got a lot of low-level mistakes.
$ (' mycons '). value+= "
Thank you very much for your guidance. Novice, I know what the problem is today.
Header ("Conntent-type:text/xml;charset=utf-8"); Header ("Cache-control:no-cache");
This is content-type a dozen more N.