PHP- insert innerhtml with javascript dynamically in each row of table -


innerhtml not working in case, want this:

  <table width="100%" border="0" id="table2">            <?php       include("connection.php");    $sql=mysql_query("select* b1");    while($res=mysql_fetch_array($sql))    {  	$img=$res["img"];  	$url=$res["url"];  	  ?>      <tr>        <td><script>document.body.innerhtml="<a href='"+<?php echo '$url' ; ?>.value+"'><img src='"+<?php echo '$img' ; ?>+"' / ></a>" ;</script></td>      </tr>      <?php    }    ?>    </table>

why don't this?

  <table width="100%" border="0" id="table2">            <?php       include("connection.php");    $sql=mysql_query("select* b1");    while($res=mysql_fetch_array($sql))    {  	$img=$res["img"];  	$url=$res["url"];  	  ?>      <tr>        <td><a href="<?php echo $url ; ?>"><img src="<?php echo $img; ?>" / ></a></td>      </tr>      <?php    }    ?>    </table>


Comments

Popular posts from this blog

javascript - How to get current YouTube IDs via iMacros? -

c# - Maintaining a program folder in program files out of date? -

emulation - Android map show my location didn't work -