CodingA database for my data

 

Press Ctrl+Enter to quickly submit your post
Quick Reply  
 
 
  
 From:  Peter (BOUGHTONP)  
 To:  Ken (SHIELDSIT)     
35356.152 In reply to 35356.151 
What's wrong with girls names, Gemma?
0/0
 Reply   Quote More 

 From:  af (CAER)  
 To:  ALL
35356.153 
Personally I'd dump the list of image filenames to a JS array and build the HTML client-side with Mustache, but that's me, I love client-side templating.
0/0
 Reply   Quote More 

 From:  ANT_THOMAS   
 To:  ALL
35356.154 
Yay I'm rubbish :C Some code
PHP code:
$sold1 = $row[sold];
if ($sold1 == yes){
$soldstring .= "<img alt=\"sold\" src=\"./photos/{$row[thumb]}\" />"; }
else {
$soldstring .= "<img alt=\"notsold\" src=\"./photos/{$row[thumb]}\" />"; }
echoing
PHP code:
" . $soldstring . "
This does as expected for the first result from the DB. But the next result contains the first image as well, and the next one the previous and so on.

So the top result shows correctly, but each result after has extra images, meaning on the 10th result it shows the correct image plus the 9 previous.

Why? :(
0/0
 Reply   Quote More 

 From:  Drew (X3N0PH0N)  
 To:  ANT_THOMAS      
35356.155 In reply to 35356.154 
.= adds to a string, = sets a string. You want = in this case. i.e.:

code:

$sold1 = $row[sold];
if ($sold1 == yes){
$soldstring = "<img alt=\"sold\" src=\"./photos/{$row[thumb]}\" />"; }
else {
$soldstring = "<img alt=\"notsold\" src=\"./photos/{$row[thumb]}\" />"; }
0/0
 Reply   Quote More 

 From:  ANT_THOMAS   
 To:  Drew (X3N0PH0N)     
35356.156 In reply to 35356.155 
(hug)
0/0
 Reply   Quote More 

 From:  Ken (SHIELDSIT)  
 To:  Peter (BOUGHTONP)     
35356.157 In reply to 35356.152 
Nothing at all except he's not a girl like you!


0/0
 Reply   Quote More 

 From:  Peter (BOUGHTONP)  
 To:  Ken (SHIELDSIT)     
35356.158 In reply to 35356.157 
Then who is he a girl like?
0/0
 Reply   Quote More 

Reply to All    
 

1–20  …  101–120  121–140  141–158

Rate my interest:

Adjust text size : Smaller 10 Larger

Beehive Forum 1.5.2 |  FAQ |  Docs |  Support |  Donate! ©2002 - 2024 Project Beehive Forum

Forum Stats