This forum is no longer open and is for reading/searching only.

Please use our new MachForm Community Forum instead.

MachForm Community Forums » MachForm 3

Display issues in queries


  1. arturom
    Member

    Hello,

    Awesome software!!

    I have a couple of questions concerning queries I'm running from MachForm.

    I'm doing this simple query:

    echo "<div id=\"Actirightcolumn\">
    <div id=\"fecha\">" . utf8_encode($row["element_9"]). "</div>
    <div id=\"actititle\">" . utf8_encode($row["element_1"]). "</div>
    <div id=\"actititle\">" . utf8_encode($row["element_2"]). "</div>
    <div id=\"actititle\">" . utf8_encode($row["element_3"]). "(Tipo de archivo)</div>
    <div id=\"actititle\">" . utf8_encode($row["element_4"]). "</div>
    <div id=\"actides\">" . utf8_encode($row["element_5"]). " <span id=\"moreinfo\">VER MÁS</span> </div>
    </div>";

    1. "element_9" is the date. But it's showing up like: 2012-03-28 instead of 28-03-2012 (DD-MM-YYYY) which is the date format I selected on the backend for this field. How can I have it show up in this format (DD-MM-YYYY)?

    2. "element_3" is a drop-down where user selects the type of file being uploaded (PDF, DOC, JPG, etc). This particular query shows a number,
    like: 1, 2, 3 rather than the name of the type of file indicated in the form. So, how can I get it to display: PDF, DOC, JPG, etc. instead of: 1, 2, 3, etc.?

    3. I'm having users upload files using the forms and it's working great. On the display (query) page I need to add an option to allow users to "download" files. What would you recommend I do for that?

    Thank you very much for your excellent support!

    Posted 12 years ago #
  2. yuniar

    1) You can use the date_format() function on your query. Can you let me know your query?

    2) Those are the index of the dropdown. To get the actual values, you will need to do a lookup into "ap_element_options" table. You can do a JOIN query for this. You might want to check this post below for some sample:
    http://www.appnitro.com/forums/topic/drop-downs-and-mysql?replies=11

    3) You will need to construct the download link again, using the same method as MachForm does. You can look into "includes/entry-functions.php" file around line 545-581. You'll find the code there.


    MachForm Founder

    Posted 12 years ago #
  3. arturom
    Member

    Thank you very much Yuniar,

    1) This is the line that displays the date: <div id=\"fecha\">" . utf8_encode($row["element_9"]). "</div>

    Also, thank you for your comments on the other two issues. I'll look into that!

    Kind regards.

    Posted 12 years ago #
  4. arturom
    Member

    Sorry here's the rest:

    mysql_query("SET NAMES 'charset=CP1251' ", $conn );
    $query = "SELECT * FROM ap_form_2 ORDER BY ID DESC LIMIT 1";
    $result = mysql_query($query, $conn );

    if( $result === FALSE ) {
    echo '<div class="ERROR">'.mysql_error().'</div>';
    } else {
    while($row = mysql_fetch_array($result))
    {

    Posted 12 years ago #
  5. arturom
    Member

    Hello Yuniar,

    I'm sorry, but I'm a complete newbie and don't have much experience with these matters. As far as recreating the download link I looked into "includes/entry-functions.php" file around line 545-581 like you suggested, but I don't know what piece of that code to use. I tried several thing but got error messages. Like this one: Fatal error:
    Call to undefined function mf_do_query() in /folder/query.php

    Could you please let me know what code I would need to use in order to create a download link for the query?

    Once again I thank you for your great support! Kind regards.

    Posted 12 years ago #

RSS feed for this topic

Reply