Some PHP embedded in HTML syntax convention error problem
Carefully typesetting a bit of HTML, and then slowly fill in the blanks, and finally sent two previous posts asked about nested circular query solve the problem.
However, the new problem appears, grammar is not written correctly, marked out, please advise:
PHP Code
/>//here error, say wrong |
Here is an error, say wrong |
Here is an error, say wrong |
|
Thanks a lot!
------Solution--------------------
Isset judgment in front of old questions
Explore
Reference:
notice:undefined Index:pic
This is a hint that tells you that a key to the array is not defined by pic, that is, there is no $row [' pic '].
To be blunt, it's that you don't have a PIC column in your database's Product table.
No, I did. There are three columns in the table product.
Isn't that the wrong spelling?
Notice:undefined Index: ...
------Solution--------------------
I forgot the array of numbers returned by the mysql_fetch_row () function!
You can swap with MYSQL_FETCH_ASSOC (); He will return an associative array, as well as an array where the key name is the column name
------Solution--------------------
Get into the habit of checking manuals
A return array is a return associative array ...
I'll take a closer look at the code after your question.
Explore
Reference:
I forgot the array of numbers returned by the mysql_fetch_row () function!
You can swap with MYSQL_FETCH_ASSOC (); He will return an associative array, as well as an array where the key name is the column name
Cow! Thank you
I changed the nested mysql_fetch_row to MYSQL_FETCH_ASSOC, and it's done! What is the difference between these two functions?