I am good in web development but recently started using PHP and developed few websites. I learned it myself and developing the website as per the requirement and able to do it without any issue. But I am confused the way I am doing is correct as per industry standard or not. I have see some code using MVC. Which is best practice method we need to follow. How the big company follows? Please ignore the syntax errors, Example Model I am using
Inserting record:
$sql = "insert into ....";
myql_query ($sql) or die (mysql_error());
For Displaying
<table> <tr><th>Slno</th> <th> Customer name </th>.... </tr>
<?php
$rs = mysql_query ("select * from customers");
while ($row = mysql_fetch_array($rs))
{
?>
<tr>
<td> <?php echo $row["slno"];?> </td>
<td> <?php echo $row["customername"];?> </td>
</tr>
<? }?>
</table>
Inserting record:
$sql = "insert into ....";
myql_query ($sql) or die (mysql_error());
For Displaying
<table> <tr><th>Slno</th> <th> Customer name </th>.... </tr>
<?php
$rs = mysql_query ("select * from customers");
while ($row = mysql_fetch_array($rs))
{
?>
<tr>
<td> <?php echo $row["slno"];?> </td>
<td> <?php echo $row["customername"];?> </td>
</tr>
<? }?>
</table>