Have you ever encountered this problem? The connection code of my database is written in conn. php. when used, I directly include (& quot; conn. php & quot;); reference! However, I found that when I reference the php file, it will occupy a certain amount of webpage layout space. if I do not reference it, it will be okay to directly enter the connection database code! Have you ever encountered this problem? Below is my co. have you ever encountered this problem?
My database connection code is written in conn. php. when used, I directly include ("conn. php"); reference!
However, I found that when I reference the php file, it will occupy a certain amount of webpage layout space. if I do not reference it, it will be okay to directly enter the connection database code!
Have you ever encountered this problem? Below is the content in my conn. php!
@ Mysql_connect ("localhost: 3306", "root", "") or die ("mysql connection failed ");
@ Mysql_select_db ("hu0010") or die ("db connection failed ");
Mysql_query ("set names 'utf-8 '");
This is the result displayed by directly entering the code. there is no blank space!
This is the result of reference display, blank!
Obviously, there are a lot of blank spaces. what is going on?
------ Solution --------------------
May be caused by the BOM header, or conn. php may have output.
------ Solution --------------------
Check the source code to see what causes space.
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