Jump to content

Need help on Returning a Custom Message when Mouse Over


quantumdecipher

Recommended Posts

Basically I have a page which returns data from a SQL database. Column results have a mouseover javascript which pops up a message when hovered. I highlighted the code which gives me problem. What i want to do here is that when a the sql query for the field errorMessage has no value, it returns a popup (which functions properly so far), but returns the content of the field errorMessage if it has value in the database.

 

Here's my code :

 

  <?php

$conn = mysql_connect("localhost", "root", "123456") or die(mysql_error());

mysql_select_db("test") or die(mysql_error());

$sql = mysql_query("SELECT * FROM buccaneer ORDER BY portNumber ASC")

or die(mysql_error());

 

if(mysql_num_rows($sql) == 0) {

  echo "<center><b>No ORDER/S in Queue</b></center>";

} else {

 

while($result = mysql_fetch_array($sql)) {

                echo"<tr><td class='tableContent'>".$result['portNumber']."</td>";

                  echo"<td class='tableContentDate'>".$result['dueDate']."</td>";

                  echo"<td class='tableContent'><span onmouseover=\"tooltip.show('Click to search ".$result['workObject']." at Shop Floor');\" onmouseout=\"tooltip.hide();\"><a href='http://*******?object=".$result['workObject']."&search=Overview'>".$result['workObject']."</a></span></td>";

                  echo"<td class='tableContent'><span onmouseover=\"tooltip.show('Click to search ".$result['salesOrder']." at Shop Floor');\" onmouseout=\"tooltip.hide();\"><a href='http://*******?object=".$result['salesOrder']."&search=Overview'>".$result['salesOrder']."</a></span></td>";

                  echo"<td class='tableContent'>".$result['systemStatus']."</td>";

                 

if ($result['errorMessage'] = "") {

echo"<td class='tableContent'><span onmouseover=\"tooltip.show('Click to add Error Message to ".$result['workObject']."');\" onmouseout=\"tooltip.hide();\"><a href='addRemarks.php'>".$result['systemRemarks']."</a></span></td>";

}

else {

echo"<td class='tableContent'><span onmouseover=\"tooltip.show('".$result['errorMessage']."');\" onmouseout=\"tooltip.hide();\">".$result['systemRemarks']."</a></span></td>";

}

                 

echo"<td class='tableContent'>".$result['orderType']."</td>";

echo"<td class='tableContent' id='customerName' name='customerName'>".$result['customerName']."</td>";

                echo"</tr>";

}}

?>

 

Please help as this is my project. I'm still a newbie in PHP and I have been coding for a few months only. Thanks!

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.