How do you use php to create a repeating div tag?

I will be trying to use php the next div tag which could then be repetitive. The problem is the fact there is Html code between the php rule. I have included what I’ve done so way. If you desire a visual case in point of what My organization is trying to do take a look at http: //www. mediareviewzone. com I want the tiny description boxes every single child be populated from a database. The code below should preferably enter the subject, links, description, and an image on the description box precisely as it appears now on the website. I want this then to repeat until the many descriptions have been subjected to the page. My errors start along at the < div class=" par_element2" > line simply because that it can be HTML inside php computer code. Any help could well be appricated.

< div class=" par_element" >
< php $subject_set = mysql_query(" Choose from * movies", $connection);
in the event that (! $subject_set)
die(" Collection connection failed: ". mysql_error());

though ($subject = mysql_fetch_array($subject_set))
< div class=" par_element2" >
< h2> indicate $subject" link"; indicate $subject" title"; < /a> < /h2>
indicate $subject" description"; indicate $subject" link"; examine more on replicate $subject " title";. < /a> < /div>
indicate $subject" link"; < img src= indicate $subject" picture"; alt=echo $subject" title"; name=echo $subject" title"; width=" 65" height=" 100" border=" 0" id=echo $subject" title"; /> < /a>
< /div>
< /div>

Here is the coolest thing regarding mixing HTML together with PHP…

Criminal history check drop in and out, and yet sustain the construction on the loops…
Please note, I have for you to change how WE comment, because a few comments are PHP,
plus some are HTML feedback.


<! --  starting  with  HTML  -->
< div  class="par_element">
< php
//  going  into  PHP  now ...
$subject_set  mysql_query("Select  FROM  *  movies",   $connection);
if  (!
"Database  connection  were unable:   "  .   mysql_error());

while  ($subject  mysql_fetch_array($subject_set))
//  now  we  drop  out  of  PHP,   but  we're  still  in  the  loop
<! --  this  part  is  HTML  with  PHP  variables  embedded  in  it  -->
< div  class="par_element2">
< h2> < a  href="< =$subject'link'> "> < =$subject'title'> < /a> < /h2>
< =$subject'description'>
< a  href="< =$subject'link'> "> read  more  on  < =$subject'title'> < /a> < /div>
< a  href="< =$subject'link'> "> < img  src="< =$subject'picture'> "  alt="< =$subject'title'> "  name="< =$subject'title'> "  width="65"  height="100"  border="0"  id="< =$subject'title'> "  /> < /a>
< php
//  back  into  PHP  to  pick-up  the  closing  bracket  of  the  while  picture.
  //  end  of  while  loop
<! --  back  into  HTML  again  -->
< /div>
< /div>

Thanks, that worked completely. There was a number of small changes that had to be made which appeared to be to place on the list of < /div> before the close on the while loop along with the * w

This entry was posted in Web Design and tagged , , , , , , , , , , , , , , , , , , , . Bookmark the permalink.

Related Posts

Leave a Reply

Your email address will not be published. Required fields are marked *