darkfreaks Posted June 20, 2013 Share Posted June 20, 2013 (edited) <?php include("../konnect.php"); $sql = mysql_query("SELECT * FROM ask") or die("MySQL Failure: " . mysql_error()); if (mysql_num_rows($sql) === 0) die("There were no rows returned"); while ($row = mysql_fetch_array($sql)) { $msg = $row['msg']; $mes_id = $row['mes_id']; $up = $row['up']; $down = $row['down']; $echo = <<<ECHO <div id='main'><div class='box1'><div class='up'><a href='' class='vote' id='" . $mes_id . "' title='Up' name='up'>" . $up . "</a></div><div class='down'><a href='' class='vote' id='" . $mes_id . "' title='Down' name='down'>" . $down . "</a></div></div><div class='box2' >" . $msg . " <br /><br /><div class='fb-comments' data-href='http://naturalnaring.com/engage.php?id=" . $mes_id . "' data-num-posts='2'></div><br /><br />"; ECHO; echo $echo; ?> can anyone see where i am outputting it wrong? it seems to work fine in dreamweaver locally. Edited June 20, 2013 by darkfreaks Quote Link to comment https://forums.phpfreaks.com/topic/279395-php-not-working/ Share on other sites More sharing options...
AbraCadaver Posted June 20, 2013 Share Posted June 20, 2013 http://www.catb.org/esr/faqs/smart-questions.html Quote Link to comment https://forums.phpfreaks.com/topic/279395-php-not-working/#findComment-1437102 Share on other sites More sharing options...
AbraCadaver Posted June 20, 2013 Share Posted June 20, 2013 In heredoc syntax you don't need to break in and out of the double quotes and you don't concatenate with the dot. Just put the HTML in there with the variables. Quote Link to comment https://forums.phpfreaks.com/topic/279395-php-not-working/#findComment-1437104 Share on other sites More sharing options...
darkfreaks Posted June 20, 2013 Author Share Posted June 20, 2013 i took the doublequotes and dots out it still is blank. Quote Link to comment https://forums.phpfreaks.com/topic/279395-php-not-working/#findComment-1437106 Share on other sites More sharing options...
AbraCadaver Posted June 20, 2013 Share Posted June 20, 2013 This works for me (but you are missing a closing</div>) $echo = <<<ECHO <div id='main'> <div class='box1'> <div class='up'> <a href='' class='vote' id='$mes_id' title='Up' name='up'>$up</a> </div> <div class='down'> <a href='' class='vote' id='$mes_id' title='Down' name='down'>$down</a> </div> </div> <div class='box2' >$msg<br /><br /> <div class='fb-comments' data-href='http://naturalnaring.com/engage.php?id=$mes_id' data-num-posts='2'> </div><br /><br /> ECHO; Or if you want to use it the way you had it, just don't use heredoc: $echo = "<div id='main'> <div class='box1'> <div class='up'> <a href='' class='vote' id='" . $mes_id . "' title='Up' name='up'>" . $up . "</a> </div> <div class='down'> <a href='' class='vote' id='" . $mes_id . "' title='Down' name='down'>" . $down . "</a> </div> </div> <div class='box2' >" . $msg . " <br /><br /> <div class='fb-comments' data-href='http://naturalnaring.com/engage.php?id=" . $mes_id . "' data-num-posts='2'> </div><br /><br />"; Quote Link to comment https://forums.phpfreaks.com/topic/279395-php-not-working/#findComment-1437109 Share on other sites More sharing options...
Solution darkfreaks Posted June 20, 2013 Author Solution Share Posted June 20, 2013 (edited) still ain't working i am thinking could it do with the fact that some of the javascript seems to be commented out? Edited June 20, 2013 by darkfreaks Quote Link to comment https://forums.phpfreaks.com/topic/279395-php-not-working/#findComment-1437126 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.