ZELDA Δημοσ. 22 Σεπτεμβρίου 2005 Δημοσ. 22 Σεπτεμβρίου 2005 Σε ενα μικρο φορουμ που φτιαχνω συνανταω το εξης προβλημα αρχικα με parse error >Parse error: parse error, unexpected T_STRING in C:\ το παραπανω ερρορ βγαινει οταν κανει print o παρακατω κωδικας ><?php // syndesh sto server kai epilogh db $conn =mysql_connect("localhost", "joeuser", "somepass") or die(mysql_error()); mysql_select_db("testDB",$conn) or die(mysql_error()); // sygentrosh ton 8ematon $get_topics = "select topic_id, topic_title, date_format(topic_create_time, '%b %e %Y at %r') as fmt_topic_create_time, topic_owner from forum_topics order by topic_create_time desc"; $get_topics_res = mysql_query($get_topics, $conn) or die(mysql_error()); if (mysql_num_rows($get_topics_res) <1) { // den yparxoyn mynhmata $display_block = "<p><em>No topics exist.</em></p>"; } else ( // dimioyrgia grammaton kai ari8mon $display_block = ' <tabloe cellpadding=3 cellspacing=1 border=1 <tr> <th>TOPIC TITLE</th> <th># of post</th> </tr>"; while ($topic_info = mysql_fetch_array($get_topics_res)) { $topic_id = $topic_id = $topic_info['topic_id']; $topic_title =stripslashes($topic_info['topic_title']); $topic_create_time = "select count(post_id) from forum posts $topic_owner = stripslashes(topic_info['topic_owner']); //eyresh ton ar8ron $get_num_posts = "select count(post_id) from forum_posts where topic_id =$topic_id"; $get_num_posts_res = mysql_query($get_num_posts, $conn) or die(mysql_error())"; $num_posts = mysql_result($get_num_posts_res, 0,'count(post_id)'); //pros8ikh ar8ron $display_block .= " <tr> <td><a href=\"showtopic.php?topic_id=$topic_id\"> <strong>$topic_title</strong><a/><br> created on $topic_create_time by $topic_owner</td> <td align=center>$num_posts</td> </tr>"; } //kleisimo toy pinaka $display_block . = "</table> } ?> <html> <head> <title>Topics in forum</title> </head> <body> <h1>Topics in my Forums</h1> <?php echo $display_block; ?> <p>would you like to <a href="addtopic.html">add a topic</a>?</p> </body> </html> Aπο οτι εχω καταλαβει για το παραπανω parse error φταιει η Line 17&25 > 17 --- > $display_block = ' kai 25 ------> $topic_id = $topic_id = $topic_info['topic_id']; παρακατω ίσως βρεθουν και αλλα parse error δε τα τσεκαρα ακομα.
Προτεινόμενες αναρτήσεις
Αρχειοθετημένο
Αυτό το θέμα έχει αρχειοθετηθεί και είναι κλειστό για περαιτέρω απαντήσεις.