Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7631509
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 31, 20262026-05-31T06:22:18+00:00 2026-05-31T06:22:18+00:00

I am using the following Code, to get data from the Database in phpmyadmin,

  • 0

I am using the following Code, to get data from the Database in phpmyadmin, and showing it in a html table. In the message column i have put a view link, to show the complete message when clicked. I have truncated the message successfully. Now that the View Link’s onclick event is not working. Please see if i am doing sth wrong.:

    <?php $i=0;?>
   <table border="1" style="position:absolute; left: 197px; top: 50px;">
   <tr>
  <td width="236" style="font-family:Ravie; color:#313253; text-align:center">Name</td>
  <td width="225" style="font-family:Ravie; color:#313253; text-align:center">
   Email Address</td>
  <td width="267" style="font-family:Ravie; color:#313253; 
  text-align:center">Message</td>
  </tr>
  <?php
  $i=0;
  while ($i < $num) {

  $f1=mysql_result($result,$i,"FullName");
  $f2=mysql_result($result,$i,"EmailAddr");
  $string=mysql_result($result,$i,"Message");
  $limit=10;
  $string1 = myTruncate($string,$limit);

  ?>

  <tr>
  <td><font face="Arial, Helvetica, sans-serif"><?php echo $f1; ?></font></td>
  <td><font face="Arial, Helvetica, sans-serif"><?php echo $f2; ?></font></td>
  <td><font face="Arial, Helvetica, sans-serif"><?php echo $string1; ?></font>
  <a href="" onclick="<?php echo $string; ?>">View</a></td>

   </tr>

   <?php
   $i++;
   }
  ?>
 </table>
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-31T06:22:19+00:00Added an answer on May 31, 2026 at 6:22 am

    The onclick requires Javascript code, you can’t just enter raw content and expect it to show after a click. Do you want to use an alert() messagebox to show the message? If so, try:

    <a href="" onclick="alert('<?php echo $string; ?>');">View</a>
    

    If you’re $string has any quotes in it you’ll need to escape them.

    I suggest adding the onclick event handler separately, for example on page load, rather than inline.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am using the following code to get data from the database( from cs
I am using following code to get data from database and load to picture
I have the following C# code, which pulls data from a database & populates
I am using the following code do get all data records from a MS
I'm using the following code to get an array with all sub directories from
I'm trying get values from a GridView using the following code: foreach (GridViewRow row
I have a very basic need to get some data from the database and
i have managed to connect to an interbase database and get data from the
Using the following code I get a nice formatted string: Request.QueryString.ToString Gives me something
I'm using the following code to get the members of a group on my

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.