darkfreaks Posted June 20, 2013 Share Posted June 20, 2013 <?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. 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 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. 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. 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 />"; Link to comment https://forums.phpfreaks.com/topic/279395-php-not-working/#findComment-1437109 Share on other sites More sharing options...
darkfreaks Posted June 20, 2013 Author Share Posted June 20, 2013 still ain't working i am thinking could it do with the fact that some of the javascript seems to be commented out? Link to comment https://forums.phpfreaks.com/topic/279395-php-not-working/#findComment-1437126 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.