im a bit noob at php and im learning it
what i would like to do is retrieve an image and text from a table of my database
so with this, i will do some news
i would like to locate them at the same position but i have trouble to do it atm
and with a set time out i would like to create a button play
i know we can do all this in javascript i did it but i want to try it with php and its more harder than i tought
ty for the big help in advance
im out of gaz ... lol
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Untitled 1</title>
</head>
<body>
<div id="listContainer" name="test">
<?php
$array = array();
$connection = mysql_connect("localhost","root","") or die("impossible de se connecter au serveur mysql.<p>Veuillez réessayer plus tard");
$res = mysql_select_db("test") or die("impossible de sélectionner la base de données <b>ecole</b>.<p>Veuillez réessayer plus tard");
$requeteStr = "SELECT path,textNouvelle from upload2";
$resultatRequete = mysql_query($requeteStr) or die("la requete de sélection a échoué.<p>Veuillez réessayer plus tard");
$result=mysql_query($requeteStr);
while ($row = mysql_fetch_array($result))
{
$array[$row['path']] = $row["path"];
//Create div with image and title
echo '<div><img src="'.$array[$row['path']].'"/><p>'.$row['textNouvelle'].'</p></div>';
}
?></div>
<script type="text/javascript">
divList = new Array();
divList = document.getElementById('listContainer').getElementsByTagName('div');
document.tata.style.left = 200;
//Hide all but first
for(var i=0,j=divList.length; i<j; i++)
{
divList[i].style.display = 'block';
}
divList[0].style.left = 200;
divList[1].style.top = 200;
divList[2].style.display = 'none';
</script>
</body>
</html>