Parse Error? Can't find it.

Yes I know it's basic, but read it.

Page 1 of 1

4 Replies - 2015 Views - Last Post: 18 June 2006 - 10:22 AM Rate Topic: -----

#1 max302  Icon User is offline

  • Proud supporter of the lulz
  • member icon

Reputation: 2
  • View blog
  • Posts: 1,281
  • Joined: 05-March 06

Parse Error? Can't find it.

Posted 16 June 2006 - 04:34 PM

Ok usually I would not post for a parse error, but I have been putting 30 minutes now on finding that stupid mistake and I just cant fin it. Here is my code.
<!-- 	=================================================
	|Visit Report by Maxime Rousseau			|
	=================================================
	|This script exploits information taken with	|
	|Visitor Counter and displays it in many formats|
	|Just set up the database parameters and your   |
	|ready to go. Again, the y disambiguation has 	|
	|been used if you once decide to include this	|
	|script in another page.				|
	================================================= -->

<head>
	<title>Visitor Stats for Tales Of a Noob</title>
</head>

<body>
<?PHP
/****************Database Parameter********************/
$ydbuser = "tales_visitor";		//Database User
$ydbhost = "localhost";			//Database Host
$ydbpasswd = "1235789";			//Database user Password	
$ydbdatabase = "tales_other";		//Database in which the visitor table is stored
$ydbconnection = mysql_connect($ydbhost,$ydbuser,$ydbpasswd);
$ydb = mysql_select_db($ydbdatabase,$ydbconnection);
/****************End Database Parameters***************/
?>
<center><h1>Visitor Statistics</h1></center>
<br />
<br />
<center>
<a href="/">Back to site</a>
<br />
<a href="visits.php">Overview</a>
/
<a href="visits.php?ymode=month">Montly Report</a>
/
<a href="visits.php?ymode=year">Yearly Report</a>
/
<a href="visits.php?ymode=etire">Entire Log</a>
<br />
<br />
<?PHP
 if ($ymode == 'month')
	{
	}
 else if ($ymode == 'year')
	{
	}
 else if ($ymode == 'entire')	//Entire Log, this is one big momma!!!
	{
	$ygetall = "SELECT * FROM visitcount ORDER BY lastvisit";
	$ygetallq = mysql_query($ygetall);
	$ygetallnum = mysql_num_rows($ygetallq);
	}
 else			//Default mode, overview
	{
	/*********************************************VARIABLES***********************************************/
	$ygetsum = "SELECT SUM OF visitcount FROM visitcount";
	$ygetsumq = mysql_query($ygetsum);
	$ygetsumr = mysql_get_array($ygetsumq);
	$ygetusers = "SELECT * FROM visitcount";
	$ygetusersq = mysql_query($ygetusers);
	$ygetusersnum = mysql_num_rows($ygetusersq);
	$ygetrecord = "SELECT * FROM visitcount ORDER BY lastvisit";
	$ygetrecordq = mysql_query($ygetrecord);
	$ygetrecordlen = mysql_num_rows($ygetrecordq);	
	/*****************************************************************************************************/

	/*****************************************20 RECENT VISITORS******************************************/
	echo "<center>/n
		<table border="2">/n
		<tr>/n
		 <td><b>User IP</b></td>/n
		 <td><b>Last Visit</b></td>/n
		 <td><b># of Visits</b></td>/n
		 <td><b>Id</b></td>/n
		 <td><b>Location</b></td>/n";
	for ($ycounter = 0;$ycounter >= 20;$ycounter++)
		{
		$yuserip = mysql_result ($ygetrecordq, $ycounter, 'userip');
	 		$ylastvisit = mysql_result ($ygetrecordq, $ycounter, 'lastvisit');
		$yvisitcount = ($ygetrecordq, $ycounter, 'visitcount');
		$yid = ($ygetrecordq, $ycounter, 'id');
		$ylocation = ($ygetrecordq, $ycounter, 'location');
		echo "<tr>
			 <td>'$yuserip'</td>/n
			 <td>'$ylastvisit'</td>/n
			 <td>'$yvisitcount'</td>/n
			 <td>'$yid'</td>/n
			 <td>'$ylocation'</td>/n
			</tr>/n";
		}
	echo "</table>/n
		</center>/n";
	/*******************************************************************************************************/
	
	}
?>


It's incomplete but it's a start. What they give me is:

Parse error: syntax error, unexpected T_LNUMBER, expecting ',' or ';' in /home2/tales/public_html/visits.php on line 71.

But there is no error on line 71. I'm all confused.

Is This A Good Question/Topic? 0
  • +

Replies To: Parse Error? Can't find it.

#2 Amadeus  Icon User is offline

  • g+ + -o drink whiskey.cpp
  • member icon

Reputation: 248
  • View blog
  • Posts: 13,506
  • Joined: 12-July 02

Re: Parse Error? Can't find it.

Posted 16 June 2006 - 04:46 PM

Are you sure your comment lines are taking? There appears to be a space between the / and * when they begin...
Was This Post Helpful? 0
  • +
  • -

#3 max302  Icon User is offline

  • Proud supporter of the lulz
  • member icon

Reputation: 2
  • View blog
  • Posts: 1,281
  • Joined: 05-March 06

Re: Parse Error? Can't find it.

Posted 16 June 2006 - 04:49 PM

View PostAmadeus, on 16 Jun, 2006 - 03:38 PM, said:

Are you sure your comment lines are taking? There appears to be a space between the / and * when they begin...

Nope, that must be a pasting problem. Comments are tight.
Was This Post Helpful? 0
  • +
  • -

#4 Amadeus  Icon User is offline

  • g+ + -o drink whiskey.cpp
  • member icon

Reputation: 248
  • View blog
  • Posts: 13,506
  • Joined: 12-July 02

Re: Parse Error? Can't find it.

Posted 16 June 2006 - 04:52 PM

$yvisitcount = ($ygetrecordq, $ycounter, 'visitcount');
$yid = ($ygetrecordq, $ycounter, 'id');
$ylocation = ($ygetrecordq, $ycounter, 'location');

Should these be function calls?
Was This Post Helpful? 0
  • +
  • -

#5 max302  Icon User is offline

  • Proud supporter of the lulz
  • member icon

Reputation: 2
  • View blog
  • Posts: 1,281
  • Joined: 05-March 06

Re: Parse Error? Can't find it.

Posted 18 June 2006 - 10:22 AM

AHA! Thanks for spotting these meanies. Be sure they'll get a beating. They're supposed to be mysql function calls.

EDIT: :( Still doesn't work, same error.

RE-EDIT: OK found it. I had put " in an echo command, when I should have put '. It's fixed now thanks Amadeus.

This post has been edited by max302: 18 June 2006 - 10:31 AM

Was This Post Helpful? 0
  • +
  • -

Page 1 of 1