Jump to content


alapimba

Member Since 15 Nov 2006
Offline Last Active Feb 24 2015 10:35 AM

Posts I've Made

In Topic: how to refresh content every minute (accoring to the clock)

03 February 2015 - 10:13 AM

Hello and thanks for your interest in helping me out.

 

Let me explain a bit better what i need.

 

i'll have 3 computers.

 

computer number 1 will show a diferent image everyday (365 images/year)

computer number 2 will show a diferent image every minute (1440 images / day)

computer number 3 will show a diferent image every second during one minute (60 images / minute)

 

This needs to be synchonized so when the computer returns to the 0 second is the moment that the computer 2 show the image for the next minute, Does it make sense?


In Topic: how to refresh content every minute (accoring to the clock)

02 February 2015 - 03:13 PM

can you help a bit more?


In Topic: Loop Throught Sql Results And Don't Print Repeated Data

23 November 2012 - 04:11 PM

everything worked perfect for my needs.
Thanks a lot for your help :)

In Topic: Loop Throught Sql Results And Don't Print Repeated Data

23 November 2012 - 03:00 PM

nice seems simple.
i'll try to use on my real data that it's a bit more complex.

the array can be generated on a while($row = mysql_fetch_assoc($result)) loop?

In Topic: Loop Throught Sql Results And Don't Print Repeated Data

23 November 2012 - 10:21 AM

Hi

I just realized that my example was too simple for my final needs :-\

i understand that example above.

but in my work i need it a bit more complex..

imagine that instead of phone numbers only i have area code and phone numbers (in separate columns).

How can i print it like:
name<br>
area code - phone number <br>
area code - phone number2 <br>
area code - phone number3 <br>
e-mail

In my real example this tables have books and authors.

some books have more then 1 author..

and i need to print it like this:

<div id="contentdiv">
<?php
$i = 0;
do {
?>
<?php				
$i = $i + 1;
?>
			 <div id="contentdiv<?php echo $row_rs_livros2['id_li']; ?>" <?php if ($i <= 1) { echo "style='display: block;'"; } else { echo "style='display: none;'"; }?>>
				 <a href="livros.php?id_li=<?php echo $row_rs_livros2['id_li']; ?>" class="titulos_vermelho_livros"><?php echo $row_rs_livros2['livro']; ?></a><br/><br/>
				
				
				 <?php //here i'll have more then 1 author sometimes ?>
				 <span class="texto"><a href="autores.php?id=<?php echo $row_rs_livros2['id']; ?>" class="titulos_livros"><?php echo $row_rs_livros2['nome']; ?><?php echo $row_rs_livros2['apelido']; ?></a><br>
	
				
				
	 <?php	
	 mb_internal_encoding("UTF-8");
	 $str = $row_rs_livros2['texto'];
	 $limit = 300; //Specify the length of the new substring
	 if (substr($str, $limit, 1) != ' ' && ($l = mb_strrpos(mb_substr($str, 0, $limit), ' '))) {
		 echo mb_substr($str, 0, $l);
	 } else {
		 echo mb_substr($str, 0, $limit);
	 }
	 ?>(...)<br />
	
				 <a href="livros.php?id_li=<?php echo $row_rs_livros2['id_li']; ?>" class="style3">ver mais ยป</a></span></div>
				 <?php } while ($row_rs_livros2 = mysql_fetch_assoc($rs_livros2)); ?>
</div>
</div>

at the moment my query is still this:
SELECT autores.id, autores.nome, autores.apelido, livros.id_li, livros.texto, livros.pdfs, livros.foto, livros.foto_grande, livros.livro, livros.ordem, ids.id_livro FROM autores INNER JOIN ids ON autores.id=ids.id_autores INNER JOIN livros ON ids.id_livro=livros.id_li WHERE estado = 'on' ORDER BY livros.ordem