Jump to content

help i keep gettin error message :(


runnerjp

Recommended Posts

Parse error: syntax error, unexpected T_CONSTANT_ENCAPSED_STRING in /home/runnerse/public_html/chatbox/maq.php on line 16

[code]
<?php
#################################
include("chatbox/connect.php");
#################################

mysql_connect($host,$dbuser,$dbpass) or die(mysql_error());
// Select the database.
mysql_select_db($dbname) or die(mysql_error());
$query = "SELECT poster, message FROM ch_messages order by id DESC LIMIT 5";
$result = mysql_query($query);
$marquee = "";
while($r=mysql_fetch_array($result))
{
   $marquee.= $r[poster]. ''. $r[message]. '</a>'";
}
echo "<marquee><font size='3'>". $marquee. "</font></marquee>";
?>[/code]
Link to comment
Share on other sites

sweet nice 1 thats done.....now i got error on line 7!!!!!
this usuall never happens lol

i will post my connect script as well just incase its a link thing

1st my connect script
[code]<?php


$host  = "localhost";
$dbuser = "my user name to db is here";
$dbpass = "this is where i have typed my pass";
$dbname = "my db name is here"; or die("Could not connect.");


if(!$db)


        die("no db");


if(!mysql_select_db("this is where i have added my db name for my chatbox",$db))


        die("No database selected.");


if(!get_magic_quotes_gpc())


{


  $_GET = array_map('mysql_real_escape_string', $_GET);


  $_POST = array_map('mysql_real_escape_string', $_POST);


  $_COOKIE = array_map('mysql_real_escape_string', $_COOKIE);


}


else


{


  $_GET = array_map('stripslashes', $_GET);


  $_POST = array_map('stripslashes', $_POST);


  $_COOKIE = array_map('stripslashes', $_COOKIE);


  $_GET = array_map('mysql_real_escape_string', $_GET);


  $_POST = array_map('mysql_real_escape_string', $_POST);


  $_COOKIE = array_map('mysql_real_escape_string', $_COOKIE);


}


?>[/code]

now my new maq

[code]<?php
#################################
include("chatbox/connect.php");
#################################

mysql_connect($host,$dbuser,$dbpass) or die(mysql_error());
// Select the database.
mysql_select_db($dbname) or die(mysql_error());
$query = "SELECT poster, message FROM ch_messages order by id DESC LIMIT 5";
$result = mysql_query($query);
$marquee = "";
while($r=mysql_fetch_array($result))
{
  $marquee.= $r[poster]. ''. $r[message]. '</a>';
}
echo "<marquee><font size='3'>". $marquee. "</font></marquee>";
?>[/code]

Link to comment
Share on other sites

????

you are checking in your 1st connect script for a connection that isn't established until you leave the connect script!
stick

mysql_connect($host,$dbuser,$dbpass) or die(mysql_error());
// Select the database.
mysql_select_db($dbname) or die(mysql_error());

straight after

$host  = "localhost";
$dbuser = "my user name to db is here";
$dbpass = "this is where i have typed my pass";
$dbname = "my db name is here"; or die("Could not connect.");

in your connect script
Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • 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.