runnerjp Posted August 21, 2006 Share Posted August 21, 2006 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 https://forums.phpfreaks.com/topic/18180-help-i-keep-gettin-error-message/ Share on other sites More sharing options...
ItsWesYo Posted August 21, 2006 Share Posted August 21, 2006 Well... one thing is for sure ... you mispelled 'marquee' on line 16. Link to comment https://forums.phpfreaks.com/topic/18180-help-i-keep-gettin-error-message/#findComment-77968 Share on other sites More sharing options...
runnerjp Posted August 21, 2006 Author Share Posted August 21, 2006 still duin it Link to comment https://forums.phpfreaks.com/topic/18180-help-i-keep-gettin-error-message/#findComment-77969 Share on other sites More sharing options...
ToonMariner Posted August 21, 2006 Share Posted August 21, 2006 the " on the end of the line in your while loop!!!!! delete it. Link to comment https://forums.phpfreaks.com/topic/18180-help-i-keep-gettin-error-message/#findComment-77974 Share on other sites More sharing options...
runnerjp Posted August 21, 2006 Author Share Posted August 21, 2006 sweet nice 1 thats done.....now i got error on line 7!!!!!this usuall never happens loli 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 https://forums.phpfreaks.com/topic/18180-help-i-keep-gettin-error-message/#findComment-77977 Share on other sites More sharing options...
ToonMariner Posted August 21, 2006 Share Posted August 21, 2006 ????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 https://forums.phpfreaks.com/topic/18180-help-i-keep-gettin-error-message/#findComment-77982 Share on other sites More sharing options...
runnerjp Posted August 21, 2006 Author Share Posted August 21, 2006 thanks i did that yet their still seems to be a problem on line 7 :S Link to comment https://forums.phpfreaks.com/topic/18180-help-i-keep-gettin-error-message/#findComment-77984 Share on other sites More sharing options...
ToonMariner Posted August 21, 2006 Share Posted August 21, 2006 what is on line 7?plus yous should create the resource handle...have$conn = mysql_connect($host,$dbuser,$dbpass) or die(mysql_error());// Select the database.$db = mysql_select_db($dbname) or die(mysql_error()); Link to comment https://forums.phpfreaks.com/topic/18180-help-i-keep-gettin-error-message/#findComment-77988 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.