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>';} ?> Quote Link to comment Share on other sites More sharing options...
Gruzin Posted October 13, 2006 Share Posted October 13, 2006 just echo " "; ;) Quote Link to comment 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. Quote Link to comment 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] Quote Link to comment 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 Quote Link to comment 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.