gpt4 book ai didi

javascript - 在 php 中调用一个函数

转载 作者:太空宇宙 更新时间:2023-11-03 12:25:39 24 4
gpt4 key购买 nike

<分区>

可能是一个菜鸟问题,但可以通过提问来学习。

我正在尝试建立一个表来从我的数据库中加载和显示数据。除了最后一列,我已经完成了所有工作。我希望最后一列是一个显示“查看图像”的链接,当您单击它时,它会打开一个 fancybox JS。

这是我的源代码:

    <script>
$(document).ready(function() {
$(".fancybox-thumb").fancybox({
prevEffect : 'none',
nextEffect : 'none',
helpers : {
title : {
type: 'outside'
},
thumbs : {
width : 50,
height : 50
}
}
});
});
</script>


<?php




mysql_select_db("premiumguns") or die(mysql_error());


echo "<table id='myTable' class='info' width='100%' border='0' cellspacing='0' cellpadding='0'>";
echo "<thead><tr> <th>Serial</th> <th>Make</th> <th>Model</th> <th>Gauge</th> <th>Barrel</th> <th>Details</th></tr></thead><tbody>";

// keeps getting the next row until there are no more to get
while($row = mysql_fetch_array( $result )) {


// Print out the contents of each row into a table

echo "<tr><td height=\"20px\">";
echo $row['Serial_No'];
echo "</td><td>";
echo $row['Make'];
echo "</td><td>";
echo $row['Model'];
echo "</td><td>";
echo $row['Gauge'];
echo "</td><td>";
echo $row['Barrel_Length'];
echo "</td><td>";
echo "<a class = "fancybox-thumb" rel="gallery1" href="wp-content/prem_pics/C16719B/C16719B-01.jpg">View Pictures</a>"
echo "</td></tr>";
}

echo "</tbody></table>";
?>
</body>

任何帮助将不胜感激

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com