Jump to content

Shoutbox code help


Steven_belfast

Recommended Posts

Hello folks,

 

Need some help on this one ,

I am trying to make a shout box for my site and found this code ,

But i get the following errors : Parse error: syntax error, unexpected T_STRING in /home/a3785887/public_html/comment.php on line 6

 

Do you think you could give me a hand some one ,

 

code is

 

<?php

//Edit only the line below

 

$dbcnx = mysql_connect("servername","dbname","username","password") 

 

 

mysql_select_db("comments");

     

    $result = @mysql_query("SELECT * FROM comtbl ORDER BY postID DESC");

    if (!$result) {

      echo("<b>Error performing query: " . mysql_error() . "</b>");

      exit();

    }

   

    while ($row = mysql_fetch_array($result) ) {

$msgTxt = $row["postTXT"];

$msgId = $row["postID"];

$SigName = $row["posterNAME"];

$SigDate = $row["postTIME"];

$msgTitle = $row["postTITLE"];

$url = $row["posterEMAIL"];

$yr = substr($SigDate, 2, 2);

$mo = substr($SigDate, 4, 2);

$da = substr($SigDate, 6, 2);

$hr = substr($SigDate, 8, 2);

$min = substr($SigDate, 10, 2);

if ($hr > "11") {

$x = "12";

$timetype = "PM";

$hr = $hr - 12;

}else{

$timetype = "AM";

}

if (!$url) {

$url = "#";

}else{

$stat = $url;

$url = "mailto:" . $url . "";

}

 

echo("<p><b>$msgTitle</b> $msgTxt<br><div align=right>

  $hr:$min $timetype | $mo/$da/$yr | $msgId, <a href='$url'>$SigName</a></div></p>");

    }

 

 

?>

 

 

Many thanks

Link to comment
https://forums.phpfreaks.com/topic/126003-shoutbox-code-help/
Share on other sites

OMFG  :-[

 

How dumb do i look now  :'(

 

Well thats what i get for not taking a break ,

 

Thanks man for the help .

 

Cant see why dreamweaver did not pick up on that  ???

 

 

Lol

Now i am just getting denied for user 'user@'localhost' (using password: YES)

I know the logins are good i have them on the other page .

But if i remove the name of the databade i get

Error performing query: No database selected

 

Am i just being thick ?

 

Link to comment
https://forums.phpfreaks.com/topic/126003-shoutbox-code-help/#findComment-651599
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.