Some errors related to syntax conventions embedded in HTML in PHP

Source: Internet
Author: User
Some errors reported by syntax conventions embedded in PHP are carefully formatted in HTML. then, the system fills in the blanks and finally solves the nested loop query issue after two posts are posted. However, when a new problem occurs, the syntax is incorrectly written and marked. please advise: PHPcode & lt ;? Phpinclude_once (conn. php); $ resultmysql_query (& quot; SELEC some PHP syntax conventions embedded in HTML report errors
Carefully typed the HTML, and then slowly filled in the blanks. Finally, I fixed the issue of nested loop queries after I posted two posts.

However, when a new problem occurs, the syntax is incorrectly written and marked. please advise:

PHP code
  
  
  
  
More
********
// An error is reported, indicating that the statement is incorrect.
// An error is reported, indicating that the statement is incorrect.
// An error is reported, indicating that the statement is incorrect.



Thank you!



------ Solution --------------------
Isset judgment before old problems

Discussion

Reference:

Notice: Undefined index: pic
This is a prompt to tell you that a key pic of the array is not defined, that is, there is no $ row ['Pic '].
Simply put, there is no pic column in the Product table of your database.


No, I checked. The Table product does have these three columns.

Isn't it written incorrectly?

Notice: Undefined index :......

------ Solution --------------------
I forgot the array of numbers returned by the mysql_fetch_row () function!
You can replace mysql_fetch_assoc (); it returns an associated array, that is, an array with the key name and column name.
------ Solution --------------------
Habit query manual
One returns an array and the other returns an associated array...
I will take a closer look at the code for your questions later.

Discussion

Reference:

I forgot the array of numbers returned by the mysql_fetch_row () function!
You can replace mysql_fetch_assoc (); it returns an associated array, that is, an array with the key name and column name.


Niu! Thank you.

I changed the nested mysql_fetch_row to mysql_fetch_assoc! What are the differences between the two functions?

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.