What will happen if this code is wrong? How to deal with it-php Tutorial

Source: Internet
Author: User
What will happen if this code is wrong? The first is true. The second type is incorrect. if there is no bean number between fields, what will happen if we follow the second method? First: {& nbsp; $ r$ empire-& gt; fetch1 (& quot; selectid, ddd, aaa, bbbfrom {$ dbtbpre} ecms _ & quot ;. $ class_r [$ classid] [what will happen if the code tbname is wrong?
The first is true. The second type is incorrect, and the fields do not contain the bean number.
What will happen if we follow the second approach?

First:
{
$ R = $ empire-> fettings ("select id, ddd, aaa, bbb from {$ dbtbpre} ecms _". $ class_r [$ classid] [tbname]. "where id = '$ ID' and classid =' $ classid 'limit 5 ");
If ($ r [id])
{
?>
Document. write (' ',' ',' ');

}
}
Else
{
?>
Document. write ('View after login ');
}
Db_close ();
$ Empire = null;
?>

Second:
{
$ R = $ empire-> fettings ("select id, ddd aaa bbb from {$ dbtbpre} ecms _". $ class_r [$ classid] [tbname]. "where id = '$ ID' and classid =' $ classid 'limit 5 ");
If ($ r [id])
{
?>
Document. write (' ',' ',' ');

}
}
Else
{
?>
Document. write ('View after login ');
}
Db_close ();
$ Empire = null;
?>

Where ddd aaa bbb is the controlled field

------ Solution --------------------
It does not matter!
Depends on different databases
------ Solution --------------------
Nothing. an error may occur. May be viewed as an alias
------ Solution --------------------
Discussion

It does not matter!
Depends on different databases

------ Solution --------------------
Select id, ddd aaa bbb.
Select id, ddd aaa will regard aaa as the alias of ddd

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.