Echoing user comments

I am having trouble with retreiving user comments.  here is my code:
if(mysql_fetch_array($sql_result) == 0) {
    echo "There are currently no comments to display. Be the first to post one!";
} else {
echo "<table width=\"100% border=2\">";
echo "<tr>";
echo "<td><b>User</b></td>
<td><b>Date/Time</b></td>
<td><b>Comment</b></td>";
echo "</tr>";
while($sql_row=mysql_fetch_array($sql_result))
$comment=$sql_row["comment"];
$date=date('D, d M Y H:i:s', $sql_row["time"]);
$user = findUserName($sql_row["user"]);
$imgAvatarSrc = "AVATAR IMAGE SOURCE";
?>
SOME HTML HERE
<br />
  <div style="float:right;"><div class="replyBtn"><a href="#btn_comment">Reply</a></div></div>
</div>
</div>
<div id="padding" style="padding:15px;"></div>
<?php
echo "<tr><td><a href='view_profile.php?user=$user' target='_blank' class='noUnderline'><img src='" . $imgAvatarSrc ."' width=65px height=65px/> " . $user . "</a><br></td></tr>";
echo "<tr><td>".$date."</td>";
echo "<td>".$comment."</td>";
echo "</tr></table>";
if there are no comments related to this image, it shows "be the first to post a comment!"  i can post in the else when there is a comment, but then in the while, nothing is printed out.  not sure where i am going wrong here... i tried removing the "else" statement, and made the while it's statement, and it worked fine. 

You've still go the same problem. You are trying to fetch the values after you have already moved the pointer ahead.
Try.
$sql="Select * from comments WHERE fileRef = '$file'";
$sql_result = mysql_query($sql,$connection1)
    or exit("Sql Error: " . mysql_error());
$sql_num = mysql_num_rows($sql_result);
if(!$sql_row = mysql_fetch_array($sql_result)) {
    echo "There are currently no comments to display. Be the first to post one!";
} else {
do { 
$comment=$sql_row["comment"];
?>
html
<?php
} while($sql_row = mysql_fetch_array($sql_result));
Alternatively, you could just test the value in $sql_num to see if any comments where posted, rather than using mysql_fetch_array. Then you could use your WHILE loop as originally posted. The key here is that once you call mysql_fetch_array, you must echo the results before calling it again.

Similar Messages

  • User Comment field available for reporting?

    User Comment field available for reporting?
    When doing custom reporting against requests with reportable dictionaries we have a user request to also include the user comments.  How do I reference / point to the comments field for a request?

    If you are referring to the comments which are added in the Comments and History section of a requisition, this information is not migrated to the datamart and is not reportable.
    If, on the other hand, you are referring to a comments field that you have included in a dictionary on the service form, that information will be available in the datamart so long as that dictionary has been made reportable.

  • How to create an interactive magazine with user comments and voting system?

    I need to create an interactive magazine that includes user comments and votes (like/unlike).
    I know that I can create digital swf magazines in indesign and that user comments and like/unlike buttons can be entered with coding in adobe dreamweaver.
    I need this for a school project and I do not know if it's possible or if there is another way of doing it in dreamweaver...
    Thanks

    The easiest way to do like/unlike voting is use facebook´s like/unlike button generator at http://developers.facebook.com/docs/reference/plugins/like/ to create a code. You can set up the appearance and some features of your button and you will end up having an iFrame code. You can add that code into your html-wrapper file with some regular texteditor like wordPad....
    Here´s one example, it´s an InDesign SWF finalized with eDocker but I don´t see any reason why you couldn´t use the SWF exported directly from InDesign as well. If you want to put it to some specific location, you have to wrap it up into a div and set up some css for that div, but it´s not a rocket science either.....=)
    http://www.prepress.fi/keva

  • Exchange Connector 3.0 RTM - Wrong action log type (user comments are sometimes analyst comments)

    Hi,
    We started using Service Manager a few days ago and I'm noticing some strange behavior from the Exchange connector. Sometimes when a user replies to an e-mail, it get's added as an "Analyst comment", also the private checkbox has a dot in it (not
    blank or checked, but a dot..)
    In this screenshot user "Marwan" is a regular user, replying to us via email...
    Any ideas?

    Today there already is intelligence that checks if the recipient == affected user. I am merely suggesting to rewise and/or extend this logic
    As I wrote, I see two possible ways here. The easy and the hard (optimal) way. The easy way would be to turn it around, meaning all comments = End-User comments unless it's coming from the Assigned User. So the check would be on the Assigned User instead
    of the Affected User as it is today. I understand that some people might complain about this, and might have adapted to the current solution, so it should be optional. In my experience I just see this as more suitable for the customers needs. Well if the source
    code could be released it would make it easier to make custom adjustments, e.g. change the Private boolean value to false etc. ;)
    The hard optimal way would be to add more options for deciding when it's an Analyst and when it's an End-User. Of course the Exchange connector can't figure that out, but if it did comparison to preselected groups or perhaps User Roles (e.g. if recipient
    is Incident Resolver and not affected user => analyst comment). 
    In any case it's an interesting discussion with many aspects, but one thing is for certain: the exchange connector is unfinished. Not broken, just lacking options. Today people are making alot of custom workflows and even their own connectors to accommodate
    for these issues. 

  • HRMS Self Service User Comments

    Hi Experts,
    We need to capture user comments displayed in either the REVIEW or the APPROVAL Self Service page for reporting purpose.
    Checked HR tables and Workflow Notification tables, but was not able to find these user comments data.
    Thanks in advance.

    I am extracting data from these three tables along with an activity history view. Note that only comments to "Salary Changes" are stored in the P_COMMENTS of the transaction values table. User comments entered by Personnel actions initiator to approver, or approver's comments do not exist in the values table. Please provide the table name and column name storing the user comments described above if you know their storage location. Thanks.

  • Get user comments from Service Manager 2012

    Hi all,
    For some Service Manager customizations, I want to "export" the user comments from incident tickets to an email message. I want to do this with Orchestrator.
    I was thinking to create a runbook with the follow components:
    - Get Incident
    - Get relationship (Related class = Trouble Ticket User comments)
    In the last activity "send mail", I want to add the user comments. But I can't find the user comments from the Published data. (see print screen) 
    Know anyone of you if it is possible to get the user comments? If Yes, How to do that?

    Hi!
    Yes, it is possible. "Get Relationship" does just exactly that, it only gets the relationship between the Incident object and the Trouble Ticket User Comment object. After you have retrieved this, you then need to get the actual related object.
    To do that, you Get Object, the class you want (in this case Trouble Ticket User Comment), then make sure you add a filter to search for the "Related Object Guid" from the published data of the Get Relationship.
    Make sure you select the "Related Object Guid"! It is a very common mistake to choose "SC Object Guid", but that is just the guid of the relationship...not the object you want ;)
    A bit tricky to understand at first, but easy enough after you get the hang of it.

  • Requesting help in extracting user comments from a forum ( HTML WEBSITE)

    hello experts,
    As i m new to java and i got this college project in hand which has to completed in few days i require some expert advise.
    Basically what my job is to extract all the user comments from a forum and make a text file.. for example this is one of the website http://www.gsmarena.com where user have posted many reviews and comments about mobile phones . ex : http://www.gsmarena.com/nokia_n97-reviews-2615p2.php .
    now looking at source code , all user comment are inside <P class="uopin"> tag under <DIV class="user-thread"> element.
    So i want to ask if there is any method in java that can extract all contents from class "uopin" directly ?
    i have no problem opening URL connection and reading the webpage but i m not able to extract that specific content . please enlighten me in this regard.
    Actually i m searching this forum since last 3 hours trying to find an answer and i found that i have to learn Regex , indexOf() subString() , HTMLEditorKit() etc.
    I ma planning to learn them in detail but as i have very less time ( 2 days to be specific) , i want help from you experts to solve this problem. plz guide me with some code snippets .
    Thankyou for your advises in advance :)

    ok.. sorry for asking that way.
    Here is my work till now....
    i wrote this code :
    import java.io.*;
    import java.io.Console;
    import java.io.BufferedReader;
    import java.io.IOException;
    import java.io.InputStreamReader;
    import java.net.URL;
    import java.util.regex.Matcher;
    import java.util.regex.Pattern;
    public class MyRobot3
         public static void main(String[] args) throws IOException
              BufferedReader in = new BufferedReader(new FileReader("MyRobot3.txt"));
              String inputLine , nextLine,kutta;
            FileOutputStream out; // declare a file output object
            PrintStream p; // declare a print stream object
              out = new FileOutputStream("myfile3.txt");
              p = new PrintStream( out );
                 while ((inputLine = in.readLine()) != null)
                             Pattern p1 = Pattern.compile("(<p\\sclass=\"uopin\">)(.*$)" );          
                        //     Pattern p1 = Pattern.compile("(<p\\sclass=\"uopin\">)(.*$\r\n.*$)" , Pattern.MULTILINE | Pattern.UNIX_LINES);    //not working
                        //Pattern p1 = Pattern.compile("(<p\\sclass=\"uopin\">)(.*\\s)" , Pattern.MULTILINE );
                             Matcher m1 = p1.matcher(inputLine);
                             boolean found = false;
                             while (m1.find())
                             p.println(m1.group(2));
    }I am testing with a little file MyRobot3.txt which contains
    <p class="uopin">Although they didn't announce any winner here. But to me the winner is <br/>
    N900. Then opera is in second position. (overall averare result)</p>And i am getting output in a file : myfile3.txt
    Although they didn't announce any winner here. But to me the winner is <br/>which is just the first line , but i need to match that line break also. i m not able to figure it out .please help me fixing this code so that it can match all the text and remove the <br> tag ..

  • Add user comments AXF TaskList

    Is there a way to add user comments to the AXF TaskList webtool? Currently the comments are sitting on the TaskViewer within the webtool. However this requires users to actually view a task on the Task List in order to access the Task Viewer which contain the comments at the bottom of the page. Is there a way to integrate the comments into a column that would be paired with the comments corresponding Task Number. I know in 11G this can be done easily. My company however is using 10G. I am trying to do this without modifying the BPEL Processes, I want to try and do it by modifying the JSP and Java files that make up the Task List.

    If you want to comment on Yosemite, go to the App Store and select the Yosemite link which is likely still in the Top Free list.
    You can then leave feedback there that everyone can read.

  • PHOTOSHOP ELEMENTS User comments

    How can we add user comments in an image's properties with PSE7.
    I have a iamge that contains the user comments.
    But when I import this file to PSE7 then User Comments is showing in Hexadecimal.
    Any Help!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!

    All your pictures will remain safe even after uninstalling the program. Your pictures are saved to your system in form of catalog present at C:\ProgramData\Adobe\Photoshop Elements\Catalogs\<your catalog><br />When you reinstall the program you can open this catalog and view all your photos again.

  • How to programmatically add user comment using human task data control

    Hi,
    We create the task form by using “create Task flow based on Human task”. I need to programmatically create and insert the user comment for the task. I know I need to create and insert a new element to the userCommentIterator that linked to the human task data control. But I could not get it work or find any related detail sample coding. Please help.
    Thanks a lot,
    Helen

    post it in soa suite forum
    SOA Suite
    or bpel forum
    BPEL
    to get.. quick reply.

  • Unable to capture user comments and responder in RESPOND API

    We are building a custom application that uses Oracle Workflow underneath. The application users and responsibilities have been integrated into Workflow. Notifications are acknowledged and responded to directly from the application using the PL/SQL Notification APIs.
    When using the wf_notification.respond API with the appropriate user and comment information filled in, we are still unable to capture the responder information as well as the reponders comments. In other words, the RESPONDER and USER_COMMENT fields in the WF_NOTIFICATION is blank. However, the response does seem to go through otherwise. Do we need to set some kind of user context outside of just setting the response attributes and calling the respond API? Following is the code....
    owf_mgr.wf_notification.setattrtext(p_nid,
                   'RESULT'          ,
                   'APPROVED');
    -- This procedure then caused the WF to advance to next step
    -- Respond to notification, depends on RESULT setattrtext above
    owf_mgr.wf_notification.respond(     p_nid, -- notification id     
         p_respond_comment,     -- response_comment
    p_responder     );     --responder role
    Any help is greatly appreciated.
    Thanks,
    Raj

    If you are on 11.5.10 or greater or standalone 2.6.4 if you pass the responder value to wf_notification.respond API it should be updated in wf_notifications.responder column. The comments is now updated in wf_comments table against the notification id and not wf_notifications.user_comment column.
    Thanks, Vijay

  • How to put user comments in WSDL File through webservices

    I created one web service application and i deployed and it is running.
    Now I want to put comments (like what is the parameters, type) in wsdl file for
    each method in my web service.
    I am using web logic server 8.1 service pack 2.
    Any can give answers to my question

    Use the sap-user parameter in the WSDL...for more information refer: /people/stefan.grube/blog/2006/09/21/using-the-soap-inbound-channel-of-the-integration-engine
    Regards,
    Abhishek.

  • E-Mail End User comments are not working when Activity is applied to Incident

    Hey Together,
    i have a strange Problem.
    I use a workflow which Triggers relationship changes of the affected user of an incident.  And when the affected user changes, a template with a runbook Automation activity will be applied that triggers a runbook for the notification.
    Today i figured out that the Exchange Connector will
    not Import comments via email anymore when i apply the Runbook Activity to the incident ?
    The Event log says:
    Exchange Connector: Unable to process mail item. Subject="TEST Connector [IR555]", Error Message=The key value of an object cannot be changed.
    As soon as i delete the activity from  the incident everything works again as it should.
    I have installed the 3.1 Version of the Connector.
    Has anybody an idea why this happens?  I cannot find a direct relation between Acion Log Comments and Activity ???
    thanks
    Chris

    Not exactly. I would simply either:
    create a new incident from the template which contains the runbook automation activity
    or
    create a new incident and apply the template
    both ways you end up with a brand spanking new incident with the activity attached. Then start sending emails to that incident and see if the error persists.
    http://codebeaver.blogspot.dk/

  • How to add multiple like/unlike buttons and users comments?

    I want to create a horizontal scrolling website with a set of images, like a film strip.
    Under each image I want the user to input a comment and click like/unlike under each photo.
    I want that all users see others' comments and the like/unlike counter under each image.
    I do not know coding and I need this for a school project.
    Thanks

    It's probably easier to use a wordpress blog setup and a plugin.  You could avoid all the coding issues.  You could take a look at my blog
    here at Best Biometric Gun Safe I did this blog completely through wordpress and avoided all coding issues.  Hope this helps and good luck.

  • Using Shared Review via Network Folder on Windows server and PC and Mac users commenting

    We are having initiation and connection problems on the Macs (running OS 10.6.4 Snow Leopard)  with Shared Reviews (from Acrobat 9) that are stored on a Windows 2008 Server connecting via SMB. I would be very interested to hear from anyone who is successfully:
    1) Initiating Shared Reviews from a Macintosh via "Automatically collect comments on my own internal server" and navigating to a folder (with full read/write permissions for all) on a Windows server. We cannot get Acrobat (via the automated SR set-up wizard) to verify the network folder location on the Macs so that a Mac user can initiate a Shared Review. On Windows (using Parallels or logging in to a PC directly), the same users have no problem initiating and accessing Shared Reviews.
    2) Accessing Shared Reviews on a network folder (set up on a Windows 2008 server) via a Mac running OSX 10.6.4 and Acrobat 9. All users have read/write access to the folder and can navigate to it via the server. They can save documents to the network folder and open other documents there as well. When they open a Shared Review-enabled PDF for commenting, they get the error message that Acrobat cannot connect to the server. Retry results in the same error message.
    We use Shared Reviews extensively and have no problems with PC users accessing the files and Mac users accessing them via Windows (Parallels or on a PC). This is very frustrating so I would really appreciate any ideas, especially if anyone is actually doing Shared Reviews this way.
    Thanks.

    Unfortunately, this is NOT fixed based on the testing I have done.
    1) I am still unable to connect to the network folder on a Windows server from the Mac to initiate a Shared Review In Acrobat version 9.4.6. Same error message as previous Unable to locate server. See screenshot:
    2) One of the Mac users (also upgraded to Acrobat 9.4.6) who was invited to participate in a Shared Review (initiated using Parallels/Windows) was initially able to open the file and Publish comments. However, after she did and closed the file, she was unable to reopen the same file, connect to the server and add comments. And no other Mac user could access the file after she added her first comments. We all got the error message "Unable to connect etc" See screenshot.
    3) I opened the same file in Parallels/Windows with no problem. However, the Mac user's comments were not there. I could add comments and publish in Windows.
    4) When I tried to access the Tracker from my Mac (review was initiated via Parallels), I got the error message File not Found when I tried to access the test review via my Mac (see screenshot).
    Could you give me more information about the fix? I would also be happy to talk to you or send more details if that would help.
    Our set up has not changed from the original information I sent (there may have been some Mac updates -- we are all on OS 10.6.8 but still Snow Leopard). Server has not changed.

Maybe you are looking for