Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

Tooltip for php/mysql

Posted on 2011-02-15
6
Medium Priority
?
1,397 Views
Last Modified: 2013-12-13
Hi all,

I have just converted my html website to php and added a database too it. I am using the same tooltip I used for the old html site and am trying to get it to work with php/mysql.

you can view the website at : ttp://irwells.homeftp.net

I would like the tooltip to get the information from the database to display product name, price and dimenstio etc.

can any help or direct me to a tooltip that work with php/mysql?
 ps im ussing a wz_tooltip
<!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">
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
 <link rel="stylesheet" href="../css/styleSheet.css" type="text/css" />
 <meta name="robots" content="NOINDEX" />
<head>
    <title>Tables Gallery</title>
</head>

<body>
  <script type="text/javascript" src="../js/wz_tooltip.js"></script>

    <script type="text/javascript" src="../js/functions.js"></script>

    <script type="text/javascript">
    function ToolTip() {
            Tip('<strong>Dimensions:</strong><br />Height 45cm<br />Width 46cm<br />Depth 26cm<br />Weight 4.8KG<br /><br />Click image for more information.', TITLE, <?php $row['product_name']; ?>'title <?php $row['product_name']; ?>', PADDING, 9, STICKY, true, DURATION, 4500, OPACITY, 80, BGCOLOR, '#C5C5C5', BORDERCOLOR, '#343434', FONTCOLOR, '#343434', OFFSETX, 50);
            return false;
        }
    </script>
<!-- Start of Container -->
<div id="container">
<?php
include ('../includes/header.html');
require_once ('../../secure/connect.php');
include ('../includes/mainMenu.php');
?>
    
<!-- Start of Picture viewer -->
<?php
// Retrieve the products information:
$q = "SELECT * FROM `products` INNER JOIN `category` ON products.category_id=category.category_id INNER JOIN `images` ON products.product_id=images.product_id WHERE category_type=\"Tables\" AND print_name=\"main\" ";

//Display results
$r = mysqli_query($mysqli, $q);
if(mysqli_num_rows($r) >=0){
     // Show Results
    $row = mysqli_fetch_array($r, MYSQLI_ASSOC);
    
// Create the form:

//<!-- Main picture display area-->
echo'<div id="picViewer_mainPic">';
 if($row["print_name"] =="")
    {
        echo"<img src=\"../../images/nophoto_large.gif\" onmouseover=\"return prev(this)\" onmouseout=\"UnTip()\"/>";
    }else
        {
        echo'<a href="../products/product.php?id=' . $row['product_id'] . '">';
        echo"<img id='theImg' src=\"../../uploads/".$row['image_name']."\" class=\"display_Image\" onmouseover=\"return prev(this)\" onmouseout=\"UnTip()\"/></a>";
        }
echo'</div>';
//<!-- End of Display Area -->

//<!-- Thumbnail display area -->
echo' <div id="picViewer_Thumbnails">';
echo'   <div id="Div1">';
 if($row["print_name"] =="")
    {
        echo"<img src=\"../../images/nophoto_large.gif\" onmouseover=\"return prev(this)\" onmouseout=\"UnTip()\"/>";
    }else
        {
        echo'<a href="../products/product.php?id=' . $row['product_id'] . '">';
        echo"<img src=\"../../uploads/".$row['image_name']."\" class=\"thumbnail_Portrait\" onmouseover=\"return prev(this)\" onmouseout=\"UnTip()\"/></a>";
        }
echo'   </div>';
        //Thimbnail Images
        while ($row = mysqli_fetch_array($r, MYSQLI_ASSOC)){
        for($i=0; $i < count($row['image_name']); $i++){
            
echo'   <div id="Div2">';
echo'       <a href="../../uploads/' . $row["image_name"] . '"  >';
echo"       <img src=\"../../uploads/".$row["image_name"]."\" class=\"thumbnail_Portrait\" onmouseover=\"return prev(this)\" onmouseout=\"UnTip()\" /></a>";
echo'   </div>';

            if($row = mysqli_fetch_array($r, MYSQLI_ASSOC)){

echo'   <div id="Div1">';
echo'       <a href="../../uploads/' . $row["image_name"] . '"  >';
echo"       <img src=\"../../uploads/".$row["image_name"]."\" class=\"thumbnail_Portrait\" onmouseover=\"return prev(this)\" onmouseout=\"UnTip()\" /></a>";
echo'   </div>';
            }
        }
        }

echo'</div>';
//<!-- End of thumbnail display area -->

}
 mysqli_free_result ($r);
 mysqli_close($mysqli);
 ?>
  <!-- Start of Footer -->
 <div id="footer2"><a href="../index.php">Home</a></div>
</div>
</body>
</html>

Open in new window

0
Comment
Question by:irwells
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
6 Comments
 
LVL 111

Expert Comment

by:Ray Paseur
ID: 34898856
This might be easiest if you use jQuery.

http://phpmysql.co.in/jquery/tooltip/
http://docs.jquery.com/Plugins/tooltip

In line 17 of your script above, change as shown in the code snippet.
Tip('<strong>Dimensions:</strong><br />Height 45cm<br />Width 46cm<br />Depth 26cm<br />Weight 4.8KG<br /><br />Click image for more information.', TITLE, <?php echo $row['product_name']; ?>'title <?php echo $row['product_name']; ?>', PADDING, 9, STICKY, true, DURATION, 4500, OPACITY, 80, BGCOLOR, '#C5C5C5', BORDERCOLOR, '#343434', FONTCOLOR, '#343434', OFFSETX, 50);

Open in new window

0
 

Accepted Solution

by:
irwells earned 0 total points
ID: 34905712
Thanks for the reply.

I have found the solution by adding the code to my script
<img src=\"../../uploads/".$row["image_name"]."\" class=\"thumbnail_Portrait\" onmouseover=\"Tip('$dimension<br/><br/>Click for more information.', SHADOW, true, TITLE, '$name', PADDING, 9, STICKY, true, DURATION, 4500, OPACITY, 80, BGCOLOR, '#C5C5C5', BORDERCOLOR, '#343434', FONTCOLOR, '#343434', OFFSETX, 50); return prev(this)\" onmouseout=\"UnTip()\" /></a>";

it has sorted the problem.
many Thanks
0
 
LVL 29

Expert Comment

by:fibo
ID: 34936481
Irwells,
you might consider closing this question by saying you have an answer and allocating points to a single answer or several answers, yours included.
0
Concerto Cloud for Software Providers & ISVs

Can Concerto Cloud Services help you focus on evolving your application offerings, while delivering the best cloud experience to your customers? From DevOps to revenue models and customer support, the answer is yes!

Learn how Concerto can help you.

 
LVL 1

Expert Comment

by:DoCBReeD
ID: 34947970
I've found jquery tools to be very useful: http://flowplayer.org/tools/demos/index.html
0
 

Author Comment

by:irwells
ID: 35358043
The experts apove didn't find the solution I was looking for, after further research I foun the solutiom myself. See notes above
0
 

Author Closing Comment

by:irwells
ID: 35390621
Problem solved by myself
0

Featured Post

On Demand Webinar: Networking for the Cloud Era

Did you know SD-WANs can improve network connectivity? Check out this webinar to learn how an SD-WAN simplified, one-click tool can help you migrate and manage data in the cloud.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Part of the Global Positioning System A geocode (https://developers.google.com/maps/documentation/geocoding/) is the major subset of a GPS coordinate (http://en.wikipedia.org/wiki/Global_Positioning_System), the other parts being the altitude and t…
Nothing in an HTTP request can be trusted, including HTTP headers and form data.  A form token is a tool that can be used to guard against request forgeries (CSRF).  This article shows an improved approach to form tokens, making it more difficult to…
Learn how to match and substitute tagged data using PHP regular expressions. Demonstrated on Windows 7, but also applies to other operating systems. Demonstrated technique applies to PHP (all versions) and Firefox, but very similar techniques will w…
The viewer will learn how to create and use a small PHP class to apply a watermark to an image. This video shows the viewer the setup for the PHP watermark as well as important coding language. Continue to Part 2 to learn the core code used in creat…

670 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question