Jnerocorp Posted April 25, 2011 Share Posted April 25, 2011 Hello, I have this error and I cant figure out what is causing it , anyone able to help? Error: Parse error: syntax error, unexpected T_STRING in /home/******/public_html/******/manage.php on line 54 Line 45: $result = mysql_query(SELECT * FROM p8_subscribers) or die(mysql_error()); Here is my code: <?php include('config.php'); include('functions.php'); ?> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html lang="en-us" dir="ltr"> <head> <title>JneroMailer</title> <link href="./style.css" media="screen" rel="stylesheet"/> </head> <body> <div class="container"> <div id="navigation"> <ul id="menu"> <li><a href="./index.php">Home</a></li> <?php if(isset($_SESSION['loggedin'])) { echo " <li><a href='./newsletter.php'>Send Newsletter</a></li> <li><a href='./manage.php'>Manage Subscribers</a></li> <li><a href='./archive.php'>Newsletter Archive</a></li> <li><a href='./index.php?logout'>Logout</a></li>"; } ?> </ul> </div> <div id="header"> <div id="logo"></div> <form action="./index.php?login" method="post"> <div id="login"> <?php if(!isset($_SESSION['loggedin'])) { echo "Username: <input type='text' name='username' /> "; echo "Password: <input type='password' name='password' />"; echo "<input type='submit' name='login_go' value='Login' />"; } else { echo "Welcome <b>".$_SESSION['username']."</b>"; } ?> </div> </form> </div> <div id="content"> <h2>Manage Subscribers</h2> <?php if(isset($_SESSION['loggedin'])) { $result = mysql_query(SELECT * FROM p8_subscribers) or die(mysql_error()); echo "<table border='1'>"; echo "<tr>"; echo "<th>ID</th><th>Name</th><th>Email</th><th>Active</th><th>Authorization</th><th>Edit</th><th>Delete</th>"; echo "</tr>"; while($row = mysql_fetch_array( $result )) { echo "<tr>" echo " <td>".$row['id']."</td> <td>".$row['name']."</td> <td>".$row['email']."</td> <td>".$row['active']." <a href='./activate.php?activate=".$row['id']."&auth=".$row['authorization']."'>Force Activate</a></td> <td><a href='./edit.php?sub=".$row['id']."><img src='./images/edit.png' alt='Edit' border='0' /></a></td> <td><a href='./edit.php?sub=".$row['id']."&delete=yes'><img src='./images/delete.png' alt='Delete' border='0' /></a></td> </tr>"; } echo "</table>"; } else { echo "YOU ARE NOT AUTHORIZED TO ACCESS THIS PAGE"; } ?> </div> </div> <div id="footer"> <div class="container"> Copyright 2011 <a href="http://www.JneroCorp.biz">JneroCorp</a> - JneroMailer </div></div> </body> </html> Quote Link to comment https://forums.phpfreaks.com/topic/234645-parse-error-syntax-error-unexpected-t_string-in-help/ Share on other sites More sharing options...
wildteen88 Posted April 25, 2011 Share Posted April 25, 2011 You're getting that error due to you not wrapping the query within quotes. This is how line 54 should read $result = mysql_query('SELECT * FROM p8_subscribers') or die(mysql_error()); Quote Link to comment https://forums.phpfreaks.com/topic/234645-parse-error-syntax-error-unexpected-t_string-in-help/#findComment-1205824 Share on other sites More sharing options...
Jnerocorp Posted April 25, 2011 Author Share Posted April 25, 2011 oh im always making those little mistakes Thanks Quote Link to comment https://forums.phpfreaks.com/topic/234645-parse-error-syntax-error-unexpected-t_string-in-help/#findComment-1205832 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.