d22552000 Posted August 12, 2007 Share Posted August 12, 2007 For the life of me I can't figure out what's wrong... function getcombo($ID) { $sql = "SELECT * FROM 'roll' WHERE `ID`=" . $ID . ""; $result = mysql_query($sql); if (!$result) { die('Invalid query: ' . mysql_error()); } else { while ($row = mysql_fetch_assoc($result)) { echo "Roll ID: "; echo $row['ID']; echo "<br /><br />"; echo $row['combo']; echo " = "; echo $row['outcome']; echo "<br /><br />"; echo "Date Rolled: "; echo $row['when']; echo "<br />"; } } } and when I run this function I get: Parse error: syntax error, unexpected T_STRING in C:\Inetpub\wwwroot\db-roll.php on line 24 This points to the line: echo $row['ID']; Please tell me why it isn't working. EDIT: after using this sites syntax highlighter it look slike I forgot to close a quotation on the result string... but I don't see it..? EDIT: I dont know why, but when I put an extra " at the end of the function it passed -,- thanks for the syntax highlighter. Do you know of any programs that are close to this WITHOUT their automatic preview? Link to comment https://forums.phpfreaks.com/topic/64559-solved-php-mysql-select/ Share on other sites More sharing options...
felipeebs Posted August 12, 2007 Share Posted August 12, 2007 About the syntax, I can't halp... no enough time right now If you want a syntax highlighter, try using Notepad2 tha can be downloaded from http://sourceforge.net/projects/notepad2/ It's like the windows' notepad but highlight sntaxes very well (I use it and recomend) Link to comment https://forums.phpfreaks.com/topic/64559-solved-php-mysql-select/#findComment-321818 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.