So i know basic php, i can connect, create db's, tables, insert, select, drop record, tables, db...... do it all in a few lines of php really.
So i can search a db using what i assume is a basic "select from" in php and display the results in a table on the page or i verify a login etc,,, BUT i look at some php code say from the likes of php code generators and looks a good bit more advanced just to do the same thing i think.....i mean what else can it be doing that needs all that code.
What am i missing here, will my basic php manage what else do i need to know?
I am taking about really verifiyng logins, retrieving data for to dispaly on the web page, inserting new data, images, all data really, i just can't understand why i see all his advanaced php code for which i assume must be doing the same thing.
My php skills don't allow me to eaily see what this adavnced code is doing so...hence i am baffled.
ALTHOUGH this advanced code is not singly for working with db's it's part of an overall system of database + displaying the results so maybe most of the code is about displaying, i don't know.
Take this code for exmaple, this is what i would us,
<?php
$con = mysql_connect("localhost","peter","abc123");
if (!$con)
{
die('Could not connect: ' . mysql_error());
}
mysql_select_db("my_db", $con);
$result = mysql_query("SELECT * FROM Persons");
while($row = mysql_fetch_array($result))
{
echo $row['FirstName'] . " " . $row['LastName'];
echo "<br />";
}
mysql_close($con);
?>
So i can search a db using what i assume is a basic "select from" in php and display the results in a table on the page or i verify a login etc,,, BUT i look at some php code say from the likes of php code generators and looks a good bit more advanced just to do the same thing i think.....i mean what else can it be doing that needs all that code.
What am i missing here, will my basic php manage what else do i need to know?
I am taking about really verifiyng logins, retrieving data for to dispaly on the web page, inserting new data, images, all data really, i just can't understand why i see all his advanaced php code for which i assume must be doing the same thing.
My php skills don't allow me to eaily see what this adavnced code is doing so...hence i am baffled.
ALTHOUGH this advanced code is not singly for working with db's it's part of an overall system of database + displaying the results so maybe most of the code is about displaying, i don't know.
Take this code for exmaple, this is what i would us,
<?php
$con = mysql_connect("localhost","peter","abc123");
if (!$con)
{
die('Could not connect: ' . mysql_error());
}
mysql_select_db("my_db", $con);
$result = mysql_query("SELECT * FROM Persons");
while($row = mysql_fetch_array($result))
{
echo $row['FirstName'] . " " . $row['LastName'];
echo "<br />";
}
mysql_close($con);
?>