View unanswered posts | View active topics It is currently Wed Aug 20, 2014 7:55 pm



Reply to topic  [ 6 posts ] 
 Help, onmouseover won't work, images from a mysql query loop 
Author Message
Junior Member

Joined: Thu Nov 12, 2009 6:04 pm
Posts: 6
Post Help, onmouseover won't work, images from a mysql query loop
Hi everyone,

I hope someone can help me, here's my problem:

I have a php script that retreive photos from a mysql db (and place it on my page into a loop in the right album section), I dont know if you understand what I mean but if you have a look at it i'm sure you'll understand

École Terre des Jeunes de Paquetville, Nouveau-Brunswick

What I need is when the user places his cursor over the thumbnail, the larger image of the thumbnail should appear in the frame just over the thumbnail row.


And part of my 'unworking' code is:

....

Code:
echo "<table border=0 width=510>";
echo "<tr>";
echo "<td align=center colspan=4>";
echo "<img id='larger' border=1 width=400 height=300>";
echo "</td>";
echo "</tr>";
echo "</table>";

$col = 0;
echo"[align=center]";
echo "<table border=0 width=210>";


$AlbumId = $row[AlbumId];
$result2 = mysql_query("SELECT * FROM PhotosTable WHERE PhotosId = '$AlbumId' order by Date DESC");
while($row = mysql_fetch_assoc($result2)) {


if ($col == 0)
echo "<tr>";
$PathG = '/' . 'tdj' . $row['PhotosPathG'];
echo "<td align=center><img border=1 src='$PathG' onmouseover='getElementById(larger).src='$PathG' width=100 height= 70'>";
echo "</td>";
$col++;
if ($col == 4)
{
echo "</tr>";
$col = 0;
}
}

echo "</table>";
echo "[/align]";

......


Thank you


Mon Dec 07, 2009 11:22 am
Report this post
Profile
Junior Member

Joined: Tue Dec 01, 2009 8:34 pm
Posts: 7
Location: Ohio, USA
Post 


Your page isn't accessible to view - it returns a 403 Forbidden error. You'll have to modify your .htaccess file before we can see it.
---------
You don't have permission to access /tdj/quoi_de_neuf.php on this server.

_________________
phpRogue - PHP, MySQL, HTML, CSS, Javascript (+ Ajax)
HackWorks: PHP game development blog and forum
Sandstorm Media: Web applications development


Mon Dec 07, 2009 11:57 am
Report this post
Profile WWW
Junior Member

Joined: Thu Nov 12, 2009 6:04 pm
Posts: 6
Post 
Humm, thats weird,

if you click on the link and then click in the adress bar and then hit enter?

École Terre des Jeunes de Paquetville, Nouveau-Brunswick


Mon Dec 07, 2009 12:04 pm
Report this post
Profile
Junior Member

Joined: Thu Nov 12, 2009 6:04 pm
Posts: 6
Post Image mouseover from DB won't load in the right image holder
Now i've solved 50% of my problem,

Whats happening now is that all the larger images appear in the same image holder (the one in the first row).


http://www.vitrail-entete.com/tdj/quoi_de_neuf_test.php

you may have to click the above link, and then click in the adress bar and hit enter, to view the page.



Any idea ?

I'm not a php expert but I guess my Image holder table is not at the right place in the code?

Javascript code...

Code:
function show_large_image(obj)
{
var large_image_obj = document.getElementById("image_holder");
large_image_obj.src = obj.src;
}


Php code...

Code:
$result = mysql_query("SELECT * FROM AlbumTable WHERE AlbumCategorie = 'Que se passe t-il' order by AlbumId DESC");
while($row = mysql_fetch_assoc($result)) {


//MY TITLE AND TEXT TABLE
echo "<span class='style1'>";
echo "<table border=0 width=510>";
echo "<tr>";
echo "<td align=center><b>$row[AlbumTitre]</b>";
echo "</td>";
echo "</tr>";

echo "<tr>";
echo "<td align=center>$row[AlbumTexte]";
echo "

";
echo "</td>";
echo "</tr>";
echo "</table>";

//MY LARGE IMAGE HOLDER TABLE
echo "<table border=0 width=510>";echo "<tr>";
echo "<td align=center colspan=4>";
echo "<img id='image_holder' border='1' width='400' height='300' src='images/transparent.gif' />";
echo "</td>";
echo "</tr>";
echo "</table>";


//MY THUMBNAILS TABLE
$col = 0;
echo"[align=center]";
echo "<table border=0 width=210>";


$AlbumId = $row[AlbumId];
$result2 = mysql_query("SELECT * FROM PhotosTable WHERE PhotosId = '$AlbumId' order by Date DESC");
while($row = mysql_fetch_assoc($result2)) {


if ($col == 0)
echo "<tr>";
$PathG = '/' . 'tdj' . $row['PhotosPathG'];
echo "<td align=center><img border='1' src='$PathG' onmouseover='show_large_image(this)' return false;\" width='100' height=

'70' />";
echo "</td>";
$col++;
if ($col == 4)
{
echo "</tr>";
$col = 0;
}
}

echo "</table>";
echo "[/align]";
echo"


";
echo "</span>";
}




Anyone know the problem?
Thanks in advance for your help


Mon Dec 07, 2009 5:58 pm
Report this post
Profile
Junior Member

Joined: Thu Nov 12, 2009 6:04 pm
Posts: 6
Post Problem solved
Thank you, my problem is now solved.


Tue Dec 08, 2009 11:30 am
Report this post
Profile
Display posts from previous:  Sort by  
Reply to topic   [ 6 posts ] 

Who is online

Users browsing this forum: No registered users and 1 guest


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
cron
© Copyright 2003-2008 www.php-editors.com. The ultimate PHP Editor and PHP IDE site.