html grammar in php grammar, how to solve it easily when mixing php grammar in html grammar

Asked 2 years ago, Updated 2 years ago, 46 views

I'm practicing how to use php, html, and mysql to sign up for a web page Php Grammar HTml Grammar Mysql Grammar is not that difficult, but like the example below, Combination? It's so hard to mix it Some examples include html grammar in echo grammar or there are so many ways, can you explain it easily?

<? while($rd = mysql_fetch_array($rs)) : $birth = substr($rd[birth], 0, 4) . "year" . substr($rd[birth], 4, 2). "month" . substr($rd[birth], 6, 2) "day"; ?> <?=$rd[record]?>"><?=$rd[name]?><?=($rd[sex] == "1")?"Male":"Female"?><?=$birth?><?=$rd[intro]?> <? endwhile; ?>

Usually, php grammar is <?PHP content?> I know it has to go in like this, but is the method above irrelevant?\

html php mysql javascript

2022-09-22 21:29

1 Answers

Think about architecture. Martin Fowler books are fine.

Now, the mvc framework is introduced at least when developing web applications. Of course, it introduces a frameworkThis does not solve all of the architectural problems, but at least it does not mix view and business logic with business logic.

Of course, it works even if you mix it all together on one page with the questioner, but please think about maintenance. Even if you try to modify a single color of a screen, you have to open a very long and complex page to find and correct that part.

Due to the nature of the software, the maintenance period is much longer than the development period. In other words, we need to develop software that is easy to maintain rather than just functional software.


2022-09-22 21:29

If you have any answers or tips


© 2024 OneMinuteCode. All rights reserved.