Jump to content

need help putting images in rows


harkly

Recommended Posts

I want to put my images in rows of 4 can anyone help me with this?

 

Right now I have the images pulling up in one long column.

 

 

      $result = mysql_query("SELECT * FROM artist WHERE artid LIKE '$search'");
        while ($r=mysql_fetch_array($result))
          {	
            $fullName=$r["fullName"];
            $dob=$r["dob"];
            $dod=$r["dod"];
            $nationality =$r["nationality"];
            $artform=$r["artform"];
            $artid=$r["artid"];
            $firstName=$r["firstName"];
            $middleName=$r["middleName"];
            $lastName=$r["lastName"];
            $otherName=$r["otherName"];
            $called=$r["called"];
            $dob_xt=$r["dob_xt"];
            $dob=$r["dob"];
            $dod_xt=$r["dod_xt"];
            $dod=$r["dod"];
            $movid_1=$r["movid_1"];
            $movid_2=$r["movid_2"];
            $movid_3=$r["movid_3"];	
            $medid_1=$r["medid_1"];
            $medid_2=$r["medid_2"];
            $medid_3=$r["medid_3"];
            $genid_1=$r["genid_1"];
            $genid_2=$r["genid_2"];
            $genid_3=$r["genid_3"];
            $perid=$r["perid"];
            $bio=$r["bio"];
            $keywords=$r["keywords"];
            $notes=$r["notes"];
            $verified=$r["verified"];




echo "<div id='artistInfo'>";
  echo "<span class='Image'>";

echo "<div class=img-shadow><img src='image/$artid/$artid.jpg' border=0 alt='$fullName'></div></span>";
echo "<span class='Text'><a href='artistDetail.php?artid=$r[artid]'>".$fullName."</a><br>".$dob." - ".$dod." <br>
      ".$nationality." - ".$artform."<br>Bio: ".$bio."</span></div>";

          }

Link to comment
https://forums.phpfreaks.com/topic/154708-need-help-putting-images-in-rows/
Share on other sites

The above has the wrong code this is the correct one for my images...

 

 

//pulls info for art work of the artist above 

            echo "<div id='title'>";
            echo "<h1>Works <br><img src='image/smLine.jpg'></h1></div>";

            $result2 = mysql_query("SELECT * FROM image WHERE artid LIKE '$search' ORDER BY title") or die(mysql_error());
            $num_rows=mysql_num_rows($result2);

              if ($num_rows != "0")
                {
                  $count = count(0);
                  while ($r=mysql_fetch_array($result2))
                    {	
                      $imgid=$r['imgid'];
                      $artid=$r['artid'];
                      $title=$r['title'];
                      $dtxt_1 =$r['dtxt_1'];
                      $dt=$r['dt'];
                      $medid=$r['medid'];
                      $size_inch=$r['size_inch'];
                      $size_cm=$r['size_cm'];
                      $musid=$r['musid'];
                      $movid=$r['movid'];
                      $genid=$r['genid'];
                      $perid=$r['perid'];
                      $bio=$r['bio'];
                      $keywords=$r['keywords'];
                      $notes=$r['notes'];
                      $verified=$r['verified'];

                    //display the row

                      echo "<div id='artContent'>";
                        echo "<span class='image'>";
                          echo $count++ ;
                          echo ". <div class=img-shadow><a href='image/$artid/$imgid.jpg' class='thickbox' title='$title by $fullName'>
                                  <img src='image/thumb/$artid/$imgid.jpg' border=0 width=75 height='100' title='$title by $fullName' align=left valign=top></a></div></span>";


                        echo "<span class='info'>";
                         echo "<a href='image.php?imgid=$r[imgid]' title='$title by $fullName'>".$title."</a> <br>".$dt."<br>".$medid."<br>".$bio." ";
                      echo "</span></div>";

                    }
                }


              else
                {
                  echo " <div id='search2'>";
                    echo "<h3>We currently do not have any art work for this artist.</h3>";
                  echo " </div>";
                }
?>

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.