Xtremer360 Posted May 3, 2010 Share Posted May 3, 2010 I am getting an unexpected T_string error? Not seeing it need a second pair of eyes! <?php print '<div id="roster">'; print '<h1 class=backstage>Singles Biographies</h1>'; print '<a href="/roster/tagteam">Tag Teams</a> | <a href="/roster/stables">Stables</a> | <a href="/roster/managers">Managers</a> | <a href="/roster/referees">Referees</a> | <a href=/roster/staff>Staff</a>'; $query = "SELECT bio.sortorder as sortorder FROM efed_bio as bio INNER JOIN efed_list_styles as style ON ( bio.style_id = style.id ) WHERE style.name = 'singles' and bio.status_id = '1' GROUP BY bio.sortorder ORDER BY bio.sortorder"; $result = mysql_query ($query); while ($row = mysql_fetch_assoc($result)) { $sortorder=$row['sortorder']; if ($sortorder == "0-9") { print '<!--<h2 class=backstage>- ".$sortorder." -</h2>-->'; } else { print '<!--<h2 class=backstage>- ".$sortorder.strtolower($sortorder)." -</h2>-->'; } print '<table>'; $querya = "SELECT bio.username as username, bio.charactername as charactername, biosingles.hometown as singleshometown, biosingles.height as singlesheight,biosingles.weight as singlesweight, FROM efed_bio as bio INNER JOIN efed_list_styles as style ON ( bio.style_id = style.id ) LEFT JOIN efed_bio_singles as biosingles ON ( bio.id = biosingles.bio_id ) WHERE style.name = 'singles' and bio.sortorder = '$sortorder' and bio.status_id = '1' ORDER BY bio.charactername"; $resulta = mysql_query ($querya); while ($rowa = mysql_fetch_assoc($resulta)) { $fieldarray=array('username','charactername','singleshometown','singlesheight','singlesweight'); foreach ($fieldarray as $fieldlabel) { if (isset($rowa[$fieldlabel])) { $$fieldlabel=$rowa[$fieldlabel]; $$fieldlabel=cleanquerydata($$fieldlabel); } } print '<tr>'; print '<td align=center>'; if (file_exists('/images/headshots/'.$posername.'.jpg')) { print '<img src='/backstage/images/headshots/".$posername.".jpg'></a>'; }else{ print '<img src='/backstage/images/headshots/default.jpg'></a>'; } print '</td>'; print '<td class=name><span class=rostername><a class=biolinks href=/backstage/bio.php?username=" . $username . ">".$charactername."</a></span>'; print 'Height: ".$singlesheight."<br />'; print 'Weight: ".$singlesweight."<br />'; print 'Hometown: ".$singleshometown."<br />'; print '</td></tr>'; } print '</table>'; print '<!--<br>-->'; print '</div>'; ?> Quote Link to comment Share on other sites More sharing options...
Zane Posted May 3, 2010 Share Posted May 3, 2010 I had an unexpected TString once.. it took me forever to find it. Turns out it was on line 123 and I was missing a semicolon. Quote Link to comment Share on other sites More sharing options...
PFMaBiSmAd Posted May 3, 2010 Share Posted May 3, 2010 If the error is near the second to the last line that was posted, those are not single-quotes. They are smart/curly quotes and are not php syntax friendly. Quote Link to comment Share on other sites More sharing options...
Xtremer360 Posted May 3, 2010 Author Share Posted May 3, 2010 Yeah lesson here is never c&p to ms word to hold your code into something else. lol I'm an idiot. Anyway now getting. Parse error: syntax error, unexpected T_CONSTANT_ENCAPSED_STRING in /home/content/y/a/n/yankeefaninkc/html/wp-content/plugins/exec-php/includes/runtime.php(42) : eval()’d code on line 32 Quote Link to comment Share on other sites More sharing options...
Xtremer360 Posted May 3, 2010 Author Share Posted May 3, 2010 New code posted in original post. Quote Link to comment Share on other sites More sharing options...
PFMaBiSmAd Posted May 3, 2010 Share Posted May 3, 2010 Just about every string in that code that contains either a php variable or contains another quote within the outer quoted string is wrong (take a look at the color highlighting that the forum software did.) A) php variables are only repalced by their value when they are contained within a string that starts/ends with double-quotes. B) Putting php variables inside double-quoted strings usually results in fewer syntax errors than using concatenate. C) Any quote within a string that is the same type of quote that started the string will close the string unless you escape it or use a different type of quote in the string than starts/ends the string. What does this thread have to do with the forum section you posted it in? It is php syntax errors in strings that are not being written correctly. Quote Link to comment Share on other sites More sharing options...
Xtremer360 Posted May 3, 2010 Author Share Posted May 3, 2010 I'm just trying to figure out which lines are needing adjusted. I know its like where it says height weight and hometown but I even took out those lines and got the same error so I know there's others. Quote Link to comment 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.