blackcell Posted January 16, 2008 Share Posted January 16, 2008 I want to loop through a small database. For each record in the database I am going to display (in a table): record1 note1 record2 note2 record2 note3 record3 note4 record4 note5 record5 note6 When I onmouseOver the record# I want to show a picture for record# I can easily do this with php and using like a "Picture Link" that is associated with the record#.png and it works. I have done it a million times but I am new to jscript and I don't know quite how to do it. What I have so far: <script type="text/javascript"> function mouseOver(imageName) { document.b1.src = imageName; } </script> <? My Loop begins here assigning variables ?> <html> <table> <tr> <td onmouseOver="mouseOver(<? echo "$record_number.png" ?>)" align="left"><? echo $recordnumber?> </tr> </html> <? My Loop ends here ?> Link to comment https://forums.phpfreaks.com/topic/86358-solved-using-a-php-variable-for-js-function/ Share on other sites More sharing options...
blackcell Posted January 16, 2008 Author Share Posted January 16, 2008 After a simple test I found that my html table header row will work fine with the jscript, but the rows that are populated by my loop that is pulling information from a mysql database will not work. Even when I use two simple pictures with no variables. Anybody got anything? Link to comment https://forums.phpfreaks.com/topic/86358-solved-using-a-php-variable-for-js-function/#findComment-441340 Share on other sites More sharing options...
phpQuestioner Posted January 16, 2008 Share Posted January 16, 2008 how do you want you picture to display; I don't see a image tag or background image any where in your code? Link to comment https://forums.phpfreaks.com/topic/86358-solved-using-a-php-variable-for-js-function/#findComment-441433 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.