Jump to content

Search the Community

Showing results for tags 'live chat'.

  • Search By Tags

    Type tags separated by commas.
  • Search By Author

Content Type


Forums

  • W3Schools
    • General
    • Suggestions
    • Critiques
  • HTML Forums
    • HTML/XHTML
    • CSS
  • Browser Scripting
    • JavaScript
    • VBScript
  • Server Scripting
    • Web Servers
    • Version Control
    • SQL
    • ASP
    • PHP
    • .NET
    • ColdFusion
    • Java/JSP/J2EE
    • CGI
  • XML Forums
    • XML
    • XSLT/XSL-FO
    • Schema
    • Web Services
  • Multimedia
    • Multimedia
    • FLASH

Calendars

  • Community Calendar

Find results in...

Find results that contain...


Date Created

  • Start

    End


Last Updated

  • Start

    End


Filter by number of...

Joined

  • Start

    End


Group


AIM


MSN


Website URL


ICQ


Yahoo


Jabber


Skype


Location


Interests


Languages

Found 2 results

  1. etsted

    live chat

    I have live chat that is supposed to display the "sender" and the "message", but instead give me some weird result. script: function get_msg(){ global $con; $query = "SELECT Sender, Message FROM chat"; $run = mysqli_query($con, $query); $messages = array(); while($message = mysqli_fetch_assoc($run)){ $messages = array('sender' => $message['Sender'], 'message' => $message['Message']); } return $messages; } <div id="messages"> <?php $messages = get_msg(); foreach($messages as $sender => $message){ echo "Sender: " . $sender . "<br >"; echo "Message: " . $message . "<br />"; } ?></div> this is what it outputs: Message has been sent. Sender: senderMessage: hiSender: messageMessage: message
  2. etsted

    undefined variable

    this is a little reference from my live chat script, but it wont work. The error message is variable $con is not defined, but it is clearly defined. $con = mysqli_connect("localhost","root","123","chat") or die(mysqli_error($con));function get_msg(){ $query = mysqli_query($con, "SELECT Sender, Message FROM chat"); $run = mysqli_query($con, $query); $messages = array(); while($message = mysqli_fetch_assoc($run)){ $messages = array('sender' => $message['Sender'], 'message' => $message['Message']); } return $messages; }
×
×
  • Create New...