note 91184 added to function.mysql-query
| From: | perezoso100 at hotmail dot com | Date: | Fri, 29 May 2009 00:35:05 +0000 |
| Subject: | note 91184 added to function.mysql-query | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-156132@lists.php.net to get a copy of this message | ||
This is another example of an easy query showing the picture in different sides in each loop.
<?
$sql="select titulo,contenido,foto,detalles from portada where portada=1";
$resultado=mysql_query($sql);
$cantidad=mysql_num_rows($resultado);
echo "There are $cantidad answers";
if($resultado==true){
$resultado=mysql_query($sql);
while($fila=mysql_fetch_array($resultado)){
$vueltas++;
if($vueltas %2==0){
$situacion="img_flota_dcha";
}else{
$situacion="img_flota_izq";
}
echo $fila['titulo'];
echo $fila['contenido'];
str_replace (â\nâ,â<br/>â,$fila['detalles']); /*replaces \n of
the database with <br> for html*/
echo substr ($fila['detalles'],0,50)
}
?>
<img src="<?= $fila['foto']; ?" class="<?=$situacion
?>">
<?
}//end while
}//end if
?>
----
Server IP: 80.64.47.13
Probable Submitter: 85.87.135.228
----
Manual Page -- http://www.php.net/manual/en/function.mysql-query.php
Edit -- https://master.php.net/note/edit/91184
Del: integrated -- https://master.php.net/note/delete/91184/integrated
Del: useless -- https://master.php.net/note/delete/91184/useless
Del: bad code -- https://master.php.net/note/delete/91184/bad+code
Del: spam -- https://master.php.net/note/delete/91184/spam
Del: non-english -- https://master.php.net/note/delete/91184/non-english
Del: in docs -- https://master.php.net/note/delete/91184/in+docs
Del: other reasons-- https://master.php.net/note/delete/91184
Reject -- https://master.php.net/note/reject/91184
Search -- https://master.php.net/manage/user-notes.php