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
// 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?