开发者

asking about data base

开发者 https://www.devze.com 2023-02-12 06:49 出处:网络
function main2(){ $sql = mysql_query(\"select * from clubs,venue where id<>\".$_SESSION[\'userid\']);
function main2(){
 $sql = mysql_query("select * from clubs,venue where id<>".$_SESSION['userid']);

  $cnt开发者_如何学Python = 0;
  while($row = mysql_fetch_array($sql)like
 <td width="19%"><?php echo $row['club_name'];?></td>

when I use this code, my entry will be double show to me. What wrong with this like club name will be show twice to me.


Probably because you don't JOIN the tables in your SQL query so the engine doesn't know how the data are related.


You're doing a JOIN on the clubs and venue table. Depending on how your rows are saved, it'll give you all the possible matches. If you have a specific result in mind, please explain it and we'll need your database schema (the structure of your DB) as well.

0

精彩评论

暂无评论...
验证码 换一张
取 消