Jump to content


Photo

Underscores = Problems?


  • Please log in to reply
7 replies to this topic

#1 lordphate

lordphate
  • Members
  • PipPipPip
  • Advanced Member
  • 154 posts

Posted 07 July 2006 - 07:12 PM

Okay so...I'm getting an error :
Parse error: syntax error, unexpected T_STRING in /*/*/*/library/db.php on line 5

Okay now here's line five
$user='longlive_arshem';    //user name for MySQL database


Now im suspecting that The error is in the "_" part of the syntax...I cannot edit the PREFIX of the SQL username and/or databases..so how do i fix this?

Thanks in advance :D

#2 kenrbnsn

kenrbnsn
  • Staff Alumni
  • Advanced Member
  • 8,235 posts
  • LocationHillsborough, NJ, USA

Posted 07 July 2006 - 07:15 PM

Please post about 10 - 15 lines above this line. An error like that usually indicates the error really occured in a previous line.

Please surround your code with [code][/code] tags.

Ken

#3 birdie

birdie
  • Members
  • PipPipPip
  • Advanced Member
  • 65 posts
  • LocationBirmingham UK

Posted 07 July 2006 - 07:15 PM

Also, a file may have been included..

#4 lordphate

lordphate
  • Members
  • PipPipPip
  • Advanced Member
  • 154 posts

Posted 07 July 2006 - 07:18 PM

<?php
// MySQL Connection Variables
// Fill in your values for the next 4 lines
$hostname='*';
$user='longlive_arshem';    //user name for MySQL database
$pass='*******';    //Password for database
$dbase='longlive_users';    //database name

$connection = mysql_connect("$hostname" , "$user" , "$pass") or die ("Can't connect to MySQL");
$db = mysql_select_db($dbase , $connection) or die ("Can't select database.");
?>


#5 .josh

.josh
  • Staff Alumni
  • .josh
  • 14,871 posts

Posted 07 July 2006 - 07:44 PM

show the code that includes this file.
Did I help you? Feeling generous? Buy me lunch! 
Please, take the time and do some research and find out how much it would have cost you to get your help from a decent paid-for source. A "roll-of-the-dice" freelancer will charge you $5-$15/hr. A decent entry level freelancer will charge you around $15-30/hr. A professional will charge you anywhere from $50-$100/hr. An agency will charge anywhere from $100-$250/hr. Think about all this when soliciting for help here. Think about how much money you are making from the work you are asking for help on. No, we do not expect you to pay for the help given here, but donating a few bucks is a fraction of the cost of what you would have paid, shows your appreciation, helps motivate people to keep offering help without the pricetag, and helps make this a higher quality free-help community :)

#6 lordphate

lordphate
  • Members
  • PipPipPip
  • Advanced Member
  • 154 posts

Posted 07 July 2006 - 07:52 PM

All my pages include this page, but its doing it on Index.php....and the code is WAYYYYY to long to post lol...but i'll post 10-15 lines before and after
or claim associated with the Service or the Provider, venue shall be

in the State of Nevada only and, in addition, you hereby consent to

the jurisdiction of the federal in the State of Nevada. You may not

assign your rights under this Agreement to any third party. The

Provider's failure to enforce any provision of these Terms of Use

shall not be construed as a waiver of any provision or the right to

enforce same. If any portion of these Terms of Use are held to be

invalid, such holdings shall not invalidate the other provisions of

these Terms of Use.<br /><br /><br /></div></body> </html> <? include 'footer.php'; } else {

// For register_global on PHP settings
$member = $_COOKIE['member'];
session_start(); // you must put this to read session variables
  if (empty($member) || !isset($member)) // fail to read the browser cookie
{                     include ('header.php'); include ('sidebar.php'); echo('
   <div id="main">

	<h1> <center>Under Construction</center> <h1>

   '); include ('footer.php');  exit;

 }
   else {

include ('header.php');
include ('sidebar.php');
include './library/sessions.php';

?>
      <div id="main">
<html>
<head>
<title>Long Live PS.com</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
</head>

<body>
<p>Upload or Download by the links.<br /><br />
By Uploading and Downloading from this site you are agreeing to the <a href="./index.php?page=TOS">terms and conditions</a> </p>
<p>&nbsp;</p>

</body>
</html></div><?php
 include ('footer.php'); exit;}
                          }
?>


#7 GingerRobot

GingerRobot
  • Staff Alumni
  • Advanced Member
  • 4,086 posts
  • LocationUK

Posted 07 July 2006 - 07:53 PM

Parse error: syntax error, unexpected T_STRING in /*/*/*/library/db.php on line 5


Well the error says it is in db.php, so we are going to need to see that.

#8 lordphate

lordphate
  • Members
  • PipPipPip
  • Advanced Member
  • 154 posts

Posted 07 July 2006 - 07:56 PM

That's what the little code was...but i just re-wrote it to :
$dbh=mysql_connect ("localhost", "longlive_arshem", "<PASSWORD HERE>") or die ('I cannot connect to the database because: ' . mysql_error());
mysql_select_db ("longlive_users");




0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users