The younger brother encountered a problem. please help me.
$ Rs = mysql_query ("select * from title ");
$ Row = mysql_fetch_array ($ rs );
$ Num = mysql_num_rows ($ rs );
// Echo $ num;
For ($ I = 1; $ I <= 8; $ I ++)
{
$ Rs = mysql_query ("select * from title where parent_id = $ I ");
$ Row = mysql_fetch_array ($ rs );
// Print_r ($ row)
?>
"Width =" 160px ">
$ SQL = "select * from index_kind where parent_id = $ I ";
$ Rs = mysql_query ($ SQL );
While ($ row = mysql_fetch_array ($ rs ))
{
?>
') "OnMouseOut =" omout (this) "id =" ">
}
?>
(This is ajax processing)
Require_once 'Conn. php ';
$ Child_id = $ _ GET ["id"];
$ Rs = mysql_query ("select * from index_kind where child_id = '$ child_id '");
$ Row = mysql_fetch_array ($ rs );
$ Nums = mysql_num_rows ($ rs );
For ($ I = 1; $ I <= $ nums; $ I ++)
{
Echo $ row ["good_img"];
}
?>
(Here is AJAX)
Function omo (obj, str)
{
// Alert (str );
Obj. style. borderBottom = "1px solid # e4393c ";
// Alert (obj. id );
Var xmlhttp;
If (window. XMLHttpRequest)
{
Xmlhttp = new XMLHttpRequest ();
}
Else
{
Xmlhttp = new ActiveXObject ("Microsoft. XMLHttp ");
}
Xmlhttp. open ("get", "chuli. php? Id = "+ obj. id, true );
Xmlhttp. onreadystatechange = function (){
// Alert (xmlhttp. readyState)
If (xmlhttp. readyState = 4)
{
Alert (xmlhttp. responseText)
Document. getElementById (str). innerHTML = "";
}
}
Xmlhttp. send (null );
}
This is the database I used for testing.
Then, when I move to this redline, the image address is displayed.
I want the image to be displayed in the black box below, but it cannot be obtained !!! Please help me solve the problem !!!
Reply to discussion (solution)
Since you document. getElementById (str). innerHTML = "";
Therefore, xmlhttp. responseText should be a valid image path.
Alert (xmlhttp. responseText) can see multiple images. The image names are regarded as the path of an image and will not be displayed in any way.
I know that because $ row [good_img] is an array, I just don't know how to display the paths in this array one by one as an image.
After the server side json is uploaded back, use the js eval to split the file one by one.
Find out how to split the code one by one