954,604 Members — Technology Publication meets Social Media
Username:
Password:
Lost login information?
Have something to say? Contribute New Article Reply to this Article

Using while loop for manage item display

Hi guys;

I am developing a website using joomla. and Im using Chrono Form and ChronoConnectivity extensions for form handling.

So using ChronoConnectivity and I am trying to display some form values. Of course no problem I can display that particular data by using ChronoConnectivity. but I need to display those data in two column.Actually those data containing Names.I need to put those name according their First name A to M in first column and N - Z names are second column

ex-

|Col A | Col B |

| A | N |

| B | O |

| C | P |

| . | . |

| . | . |

| M | Z |


I am try to use while loop for it.

<?php
    //tabela select
    $query2     = "SELECT * FROM `#__chronoconnectivity`" ;
    $count = 1;
    $column = 1;
    //loop statement
    while ($myrow = mysql_fetch_array ($query2))
    {
    // first column display
    if ($column == 1)
    {
    //field is the column in  table

    printf('<div id="agency" class="agencylist"><a href="http://74.54.206.217/~oakpark/index.php?option=com_chronoconnectivity&connectionname=agencydet&cat_id={cf_id}">',$myrow['{text_2}</a></div>']);
    //printf();
    }

    else{
    //second column display
    printf('<div id="agency" class="agencylist"><a href="http://74.54.206.217/~oakpark/index.php?option=com_chronoconnectivity&connectionname=agencydet&cat_id={cf_id}">',$myrow['{text_2}</a></div>']);
    }

    $count += 1;

    $column = $count % 2;
    }
    //loop end
    ?>


I put this code block at under Body: in Connection View Settings.
So result is this error massage.Warning: mysql_fetch_array(): supplied argument is not a valid MySQL result resource in /../components/com_chronoconnectivity/libraries/connection.php(303) : eval()'d code on line 10

Ok I am agree with you here in my code I had lot of mistake.ok If can tell me either very better way to achieve this my requirement or other proper solution I am so glad.

cheers.

Umanda Jayo Bandara

umandajayo
Light Poster
45 posts since Feb 2010
Reputation Points: 10
Solved Threads: 0
 
$query = "select * from table";
echo $query;
$result = mysql_query($query) or die(mysql_error());


check for specific error message with die statement. echo your query and copy and paste in phpadmin sql editor and execute for results. If the query not returning rows then might be the error.

rajarajan07
Nearly a Posting Virtuoso
1,447 posts since May 2008
Reputation Points: 167
Solved Threads: 239
 

thank you for your reply. but this error massage generated by ChronoConnectivity extension.

umandajayo
Light Poster
45 posts since Feb 2010
Reputation Points: 10
Solved Threads: 0
 

This article has been dead for over three months

Post: Markdown Syntax: Formatting Help
You
View similar articles that have also been tagged: