chat script small tip needed -- 2

Suoritettu Julkaistu 2 vuotta sitten Maksettu toimituksen yhteydessä
Suoritettu Maksettu toimituksen yhteydessä

Hi,

i am writing a simple chat box but im stuck because i want to choose, depends on who's message do it comes, the field color should change.

for example if the text is sent by me, it should be blue, else it should be green.

ok i have :

mysql_query("SELECT * FROM task where chat_id ='$id'ORDER BY time_created ASC")or die(mysql_error());

and i have:

$chatbox .= '

<b class="alert-info"> . $message .'</b>';

i want each message depending who its coming from be green or blue.

i wrote this code: but cant fit it in:

if ($from == $logged_user)

{

$color_code = 'blue';

} else {

$color_code = 'green';

}

if you can help me fix it and with a low cost, let me know soon

PHP JavaScript Tietojärjestelmäarkkitehtuuri MySQL HTML

Projektin tunnus: #32215814

Tietoa projektista

10 ehdotusta Etäprojekti Aktiivinen 2 vuotta sitten

Myönnetty käyttäjälle:

glennwilkins

sir message me i will help you i am php expert ... sir message me i will help you i am php expert ...

$20 USD 1 päivässä
(220 Arvostelua)
6.5

10 freelanceria on tarjonnut keskimäärin $23 tähän työhön

manishuser

Hello Sir, I have read your job description carefully start your project right now and able to lead your project to success asap. My Strong Experiences as follow: - PHP Framework Like Laravel & CodeIgniter (3+ years) Lisää

$10 USD 1 päivässä
(26 arvostelua)
4.0
hyadesfreelancer

PHP,PDO, Core-php, CakePHP, CodeIgniter, Laravel, Mysql, HTML, HTML5, CSS, JavaScript, jquery, AJax, And BUG FIXING etc. When we work for clients really feel happy because we like to work for clients to give them Lisää

$20 USD 1 päivässä
(9 arvostelua)
3.3
rutherfordandco

What is the $logged_user and $from variables? I need to know so I can help debug, have you tried to var_dump them both to see if they’re the same?

$10 USD 1 päivässä
(8 arvostelua)
3.0
payoneerdenys

Hello Client. I check your code. Now understand that you have some mistake. I can fix it in 10mins. if you select me,I will try in my best Thank you.

$30 USD 1 päivässä
(2 arvostelua)
2.8
KolyaMaksimchuk

Hi, How are you? Here is your good partner. I have read your job description and am very interested in your task. I am very familiar with Php and Sql, So I can do very well in a few hours for you. please hire me, I wil Lisää

$20 USD 1 päivässä
(2 arvostelua)
1.4