nubble Posted October 13, 2006 Share Posted October 13, 2006 I know this is probably a stupid question, but I have to ask :) How do you get PHP to echo a space? code is horking... any ideas? right now I"m trying to echo ' ' - server doesn't like that too much :)<?mysql_connect("bleh.net", "bleh", "bleh");mysql_select_db("chondros");$critter = "BM05J10";$sql = "SELECT `snakeID`, `locality`, `neonate_color`, `sex`, `description` FROM `general` WHERE `snakeID` LIKE '$critter'";$query = mysql_query($sql);while($row = mysql_fetch_assoc($query)){echo '<p class="heading">';echo $row['locality']. ' ' $row['sex']. '</p>';echo '<hr size="1" noshade color="#5B7331">';echo '<p class="text1">';echo $row['neonate_color'].'<br />';echo $row['description'].'</p>';} ?> Link to comment https://forums.phpfreaks.com/topic/23901-echoing-spaces/ Share on other sites More sharing options...
Gruzin Posted October 13, 2006 Share Posted October 13, 2006 just echo " "; ;) Link to comment https://forums.phpfreaks.com/topic/23901-echoing-spaces/#findComment-108625 Share on other sites More sharing options...
effigy Posted October 13, 2006 Share Posted October 13, 2006 [b]Update:[/b] You need a[tt] . [/tt]between your quotes and the next variable. Link to comment https://forums.phpfreaks.com/topic/23901-echoing-spaces/#findComment-108627 Share on other sites More sharing options...
redarrow Posted October 14, 2006 Share Posted October 14, 2006 was playing around wonder if this will work?[code]<?phpmysql_connect("bleh.net", "bleh", "bleh");mysql_select_db("chondros");$critter = "BM05J10";$sql = "SELECT `snakeID`, `locality`, `neonate_color`, `sex`, `description` FROM `general` WHERE `snakeID` LIKE '$critter' ";$query = mysql_query($sql)or die("query problam mysql()");while($row = mysql_fetch_assoc($query)){$x= "<p class='heading'> ".$row['locality']." \t ".$row['sex']." </p>";$x.= "<hr size='1' noshade color='#5B7331'>";$x.= "<p class='text1'>";$x.= " ".$row['neonate_color']." ";$x.= " ".$row['description']."</p>";echo $x;} ?>[/code]This is how i bedug the code to see if it worked and it did ok.[code]<?php $row['locality']="london";$row['sex']="male";$row['neonate_color']="silver";$row['description']="i am nice";$x= "<p class='heading'> ".$row['locality']." \t ".$row['sex']." </p>";$x.= "<hr size='1' noshade color='#5B7331'>";$x.= "<p class='text1'>";$x.= " ".$row['neonate_color']." ";$x.= " ".$row['description']."</p>";echo $x;?>[/code]result[code]london male --------------------------------------------------------------------------------silver i am nice[/code] Link to comment https://forums.phpfreaks.com/topic/23901-echoing-spaces/#findComment-108687 Share on other sites More sharing options...
nubble Posted October 17, 2006 Author Share Posted October 17, 2006 Thanks for your help everyone. Got the darn thing working now!-Amy Link to comment https://forums.phpfreaks.com/topic/23901-echoing-spaces/#findComment-110076 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.