我有这样的mysql设置
MySQL
表:画廊
+-------------+------------+
| galleryname | coverphoto |
+-------------+------------+
表:多画廊
+-------------+-----------+
| galleryname | galleries |
+-------------+-----------+
我正在使用 php 中的复选框数组将画廊放入multigalleries.galleries
like gallery1,gallery2,gallery3
. 所有这一切都很好,我唯一想不通的是,当我拉出列表gallery.galleryname
并用它引用它时multigalleries.galleries
,如果它存在于,我如何返回检查状态multigalleries.galleries
?
任何帮助将不胜感激。
编辑// IM使用的实际代码,如果有帮助的话
$con = mysql_connect($host,$dbusername,$dbpassword);
if (!$con)
{
die('Could not connect: ' . mysql_error());
}
mysql_select_db($databasename, $con);
$query = "SELECT galleries.gallery, galleries.coverphoto, multigalleries.multigallery, multigalleries.galleries FROM galleries, multigalleries";
$result = mysql_query($query);
while ($line = mysql_fetch_array($result, MYSQL_ASSOC)) {
echo '<div class="gallery" style="background-image:none">';
echo '<input type="checkbox" name="galleriesm[]" value="'.$line[gallery].'">'. $line[gallery].'';
echo '</div>';