Hangwire Posted September 14, 2010 Share Posted September 14, 2010 Hi all, I have a question. How do I put a new line in a script? I've tried everything. <?php $con = mysql_connect("localhost","*","*"); if (!$con) { die('Could not connect: ' . mysql_error()); } mysql_select_db("my_db", $con); $sql="SELECT * FROM People WHERE FirstName='Borko' AND LastName='Borkov'"; if (!mysql_query($sql,$con)) { die('Error: ' . mysql_error()); } echo "Found!"; echo($sql); mysql_close($con) ?> I wrapped it in <html> and so on, <br /> doesn't work. Saved it in html, <br /> still doesn't work and the script doesn't execute. The output I get right now is Found!SELECT * FROM People WHERE FirstName='Borko' AND LastName='Borkov' I want it to display Found! SELECT * FROM People WHERE FirstName='Borko' AND LastName='Borkov' And another question - how can I see what the sql variable is searching for from the browser? For now, as you have seen, I just use the echo($sql) but it doesn't quite cut it - is there a way to see just FirstName and LastName without the whole code? I tried echo($sql [FirstName] [LastName], as you've already guessed it didn't work... A hint would also be greatly appreciated! Any help on these two issues? :-\ Quote Link to comment Share on other sites More sharing options...
Pikachu2000 Posted September 14, 2010 Share Posted September 14, 2010 There is no reason I can think of that this shouldn't work: echo "Found!<br />$sql"; 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.