Software Engineering - Third Module
Here is Software Engineering - Third Module (SQL) lecture . Below Attachement contain
- Slides for Software Engineering
Click Here to Download
Downlaod Lecture of APTECH ACCP PRO Course Batch of Aptech NN 1207G1..
<?php
$username = "your_name"; $password = "your_password"; $hostname = "localhost"; //connection to the database $dbhandle = mysql_connect($hostname, $username, $password) or die("Unable to connect to MySQL"); echo "Connected to MySQL<br>"; ?> |
<?php
//select a database to work with $selected = mysql_select_db("examples",$dbhandle) or die("Could not select examples"); ?> |
<body>
<p>
<?php
echo "I'm learning PHP!";
?>
</p>
</body>
<?php
and ?>
delimiters. Here we use the function echo
to output I'm learning PHP!
. We also end the line with a semicolon.index.php
instead of index.html
. This is important! It tells the PHP interpreter that there's PHP code in the file to evaluate.echo
function outputs strings. If you type<?php
echo "Hello!";
?>
Hello!
."Hello, world!"
<?php
echo "Hello, world!";
?>
<?php
echo "Hello," . " " . "world" . "!";
?>
.
). (If you're coming to PHP from JavaScript, the dot does the same thing for strings that +
does in JavaScript.)$myName = "Beyonce";
$myAge = 32;
$
).;
). PHP requires semicolons at the end of eachstatement, which is the shortest unit of standalone code. (For example, echo"Hello!";
or 2 + 2;
)19 +
or echo
aren't complete thoughts, so you wouldn't put semicolons at the end of them!<?php echo "Use your semicolons!"; ?>
/* this syntax */
) or in our HTML (using <!-- this syntax -->
), we can also put comments in our PHP code! We do that using two forward slashes (//
), like so:<?php
echo "I get printed!";
// I don't! I'm a comment.
?>