Jump to content

Recommended Posts

Hello everybody..

 

I'm a kind of newbie in php coding.

 

i'm making a online catalog, of my dads company.

 

it's works perfect but in some products i want to show more photos and i cant and when i add one more in a product all the other products appears the problem.

i dont know what i can so to solve this problem.

 

please help me.

 

Database:

image.jpg

Table:

image.jpg

 

 

and here is the code that i use to show the images...

$result = mysql_query( "SELECT photo_caption,photo_description,photo_code,photo_filename,photo_filename2,photo_filename3,photo_filename4,photo_filename5,photo_filename6 FROM gallery_photos WHERE photo_id='".addslashes($pid)."'" );
 list($photo_caption,$photo_description,$photo_code,$photo_filename,$photo_filename2,$photo_filename3,$photo_filename4,$photo_filename5,$photo_filename6) = mysql_fetch_array( $result );
 $nr = mysql_num_rows( $result );
 mysql_free_result( $result );


 if( empty( $nr ) )
 {
  $result_final = "\t<tr><td>There is no Photos</td></tr>\n";
 }
 else
 {
  $result = mysql_query( "SELECT category_name FROM gallery_category WHERE category_id='".addslashes($cid)."'" );
  list($category_name) = mysql_fetch_array( $result );
  mysql_free_result( $result );


  $result_final .= "
  <div class='baseline'>
  <ul>
  <li><a href='javascript:history.back()'>Back</a> </li>
  <li><a href='index.php?pag=gallery'>Categories</a> </li>
  <li><a href='index.php?pag=ver&cid=$cid'>$category_name</a></li>
  </ul>
  <br style='clear:left;'/>
  </div>
  ";



  $result_final .= "
  <div class='descripcion'>
   <div id='slides'>
   <div class='slides_container'>
   <img src='".$images_dir."/".$photo_filename."' width='640' height='480' border='0' alt='Slide 1'/>
   <img src='".$images_dir."/".$photo_filename2."' width='640' height='480' border='0' alt='Slide 2'/>
    <img src='".$images_dir."/".$photo_filename3."' width='640' height='480' border='0' alt='Slide 3'/>
    <img src='".$images_dir."/".$photo_filename4."' width='640' height='480' border='0' alt='Slide 4'/>
    <img src='".$images_dir."/".$photo_filename5."' width='640' height='480' border='0' alt='Slide 5'/>
    <img src='".$images_dir."/".$photo_filename6."' width='640' height='480' border='0' alt='Slide 6'/>
 	    </div>
   <a href='#' class='prev'><img src='img/prev.png' width='28' height='44' alt='Arrow Prev'></a>
   <a href='#' class='next'><img src='img/next.png' width='28' height='44' alt='Arrow Next'></a>
   </div>
   <div class='textodesc'>
 <h2>$photo_caption</h2>
 <p><b></br></b>$photo_description</p>
  </div></div>
 ";
 }
}

 

and this is how appears in the browser

 

image.jpg

Link to comment
https://forums.phpfreaks.com/topic/273438-help-with-image-extraction/
Share on other sites

ok the problem is if i try to add andother row in the table.. all the other products have too an other space.

and i only want to add more photho in a specific products but i dont know how i can make this change in that mini system.

 

thanks for your reply jessica.

I think you are saying when you try to add another column.

 

Which brings me back to the fact that you *need* to denormalize the data. Each photo should be in it's own row in a table that stores photo file names and product ids. 

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • 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.