We've noticed that you've been inactive for over 10 minute(s). We've stopped running the Shoutbox due to your inactivity. If you are back again, please click the I'm Back button below.
I am starting to learn php using the 5.04 version. I have done the exercises that you gave us and I have noticed that the command "return" does not work, but the <br> does. Has anything been done about this in the last version?
Thank rkage for the valuable help you are bringing to the beginners.
Actually the \r\n are (return and newline) and can only be seen in the pages source not in your browsr for example write this simple code and then run it in your browser.
<?php
echo "This is a test line of characters that is very very long\n but with the addition of the newline character it will\n be viewed by viewing the page source and you will see that this long single line show up as 3 lines.";
?>
As a newbie to pHp, ( i learned .net) this is great. It was pretty helpful for me because i didn't know how the code was layed out and how to include it like this. Thanks for the tips and help.
+ -- add e.g. 10+2 = 12
- -- minus e.g. 10-2 = 8
* -- mutiply e.g. 10*2 = 20
/ -- device e.g. 10/2 = 8
< -- less than e.g. $1<10 =variable $1 has value less than 10
> -- more than e.g. $1>10 =variable $1 has value more than 10
>= -- more than or equal e.g. $1>=10 =variable $1 has value more than 10 or
=10
<= -- less than or equal e.g. $1>=10 =variable $1 has value less than 10 or =10
!= -- don't equal e.g. $1!=10 =variable $1 has value don't equal 10
== -- equal e.g. $1==10 =variable $1 's value is 10
or -- or
! -- not
and -- and
increase value
<?php
while ($1=10;$1<15;$1++)
{
echo "$1 ";
}
?>
it'll show 10 11 12 13 14
if Form:
if (function or variable){
.......echo "....";
}else{
.......echo ".....";
}
e.g.
if (mysql_db_query($dbname,$sql)){
echo "yes";
}else{
echo "no";
}
result:if it do function(mysql_db_query($dbname,$sql))complete it'll show "yes",if it do function(mysql_db_query($dbname,$sql))don't complete it'll show "no"
next row: \n e.g.
<?
echo "hh"; \n
?>
mysql you can use phpMyAdmin to handle mysql easier to connect sql by use code form:
<?php
$host="hostname";
$user="username";
$pass="password";
mysql_connect($host,$user,$pass) or die("Can't connect to mysql");
?>
to create db(database)
<?php
$host="hostname";
$user="username";
$pass="password";
mysql_connect($host,$user,$pass) or die("Can't connect to mysql");
$dbname="dbname";
mysql_create_db($dbname);
?>
i do not really know php, but just from the codings i see, i figured out the above!
i have to look forward to more coding details.. however these are very helpful!
well, these were just for displaying text, so are you coming more with the commands and more complex codings ?
i will be waiting for them...
I am starting to learn php using the 5.04 version. I have done the exercises that you gave us and I have noticed that the command "return" does not work, but the <br> does. Has anything been done about this in the last version?
Thank rkage for the valuable help you are bringing to the beginners.
try
\n\r
Windows and Unix respond differently, it is not your version but perhaps your platform. Just another thingy that you might want to try with your code try and let me know if not correct!