Before this is read the database code, omitted here ...
And then here, it's not going to happen.
找人起个名字吧!
这个名字还不错么
Problem one: The first line writes the following error:
PHP Parse error:syntax error, unexpected ' $row ' (t_variable), expecting ' (' in I:\php\index.php on line 119
The other lines have nothing wrong temporarily unknown
Question two: There is no quick way to write, that is, all by PHP, rather than with the HTML mixed together, it seems that the execution efficiency will be very poor.
Well, I admit that this is from the ASP, just learn PHP, do not know where to check these problems.
Reply content:
Before this is read the database code, omitted here ...
And then here, it's not going to happen.
找人起个名字吧!
这个名字还不错么
Problem one: The first line writes the following error:
PHP Parse error:syntax error, unexpected ' $row ' (t_variable), expecting ' (' in I:\php\index.php on line 119
The other lines have nothing wrong temporarily unknown
Question two: There is no quick way to write, that is, all by PHP, rather than with the HTML mixed together, it seems that the execution efficiency will be very poor.
Well, I admit that this is from the ASP, just learn PHP, do not know where to check these problems.
else missed a colon
No spaces in endif
If the last semicolon is changed to a colon, then add a semicolon after the endif.
The conditions after the if are wrapped in parentheses.
找人起个名字吧!
这个名字还不错么
The condition after the if is enclosed in parentheses, $row [' name], where there is a single quote missing, and else to change to else:,end if to endif;
$row['name]=""
Here's name
a short '
quote, and this judgment should not be two equals sign?
PHP to do web development mixed is inevitable. You can also use a template engine, but now you have to understand the mixed.
Master, how do I feel that you are using the CI framework.
The quick way of writing is the template engine, most of which are now in the framework. Like Laravel's blade.
@if($row['name]="" or is_null($row['name']))找人起个名字吧!@else这个名字还不错么@endif