PHP Block in Post Nuke - Problem

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Cliff Roman

    PHP Block in Post Nuke - Problem

    I have been trying to find the answer on the postnuke forums and I have even
    tried Sitepoint but I am unable to find an answer. So now I am asking here
    in hopes that someone may have an idea


    I am trying to put a query in a PHP block. However, when I do.. the block
    dissapears.

    I will try to explain better..

    If I use a query like

    $result = mysql_query("En ter Array Query Here");
    while ( $row = mysql_fetch_arr ay($result) )
    {
    ENTER CODE HERE
    }


    The block does not show up (I KNOW the query and code is good because it
    works on a seperate page)


    However, queries like the following do work
    $query = mysql_query("EN TER QUERY HERE");
    $result = mysql_result($q uery, 0, 0);

    Basically.. as soon you use a query with the line of "while ( $row =
    mysql_fetch_arr ay($result) )" the block does not show up anymore. As I
    said before, I know the query is good and it works, cause I have tested it
    on seperate pages and have even used the most basic of queries.

    When I say dissapear.. I do mean exactly that. If you use the 2nd query
    that I posted.. you can see the block on the front page. As soon as I
    change it to the other kind of query the block dissapears and is no longer
    visable.

    Anyone have any ideas? Or maybe have another way that I can accomplish the
    query that I am trying to get without using hte "while.." line? Basically
    I am trying to get FirstName, LastName and SUM(Posts) out of a table and
    sort them by SUM(Posts), keeping the top 3

    Thanks


  • Charles E. Pelkey

    #2
    Re: PHP Block in Post Nuke - Problem

    Have added any sql error checking??
    Use the mysql_error( ) function to retrieve any errors between the query,
    the fetch_array and the display of the rows.
    The syntax you show in your examples is commonly used, and I for one can not
    duplicate your problem using your example.

    -Charles

    "Cliff Roman" <cliff@nospam.t heromans.us> wrote in message
    news:BctZa.1136 37$o%2.49314@sc crnsc02...[color=blue]
    > I have been trying to find the answer on the postnuke forums and I have[/color]
    even[color=blue]
    > tried Sitepoint but I am unable to find an answer. So now I am asking[/color]
    here[color=blue]
    > in hopes that someone may have an idea
    >
    >
    > I am trying to put a query in a PHP block. However, when I do.. the block
    > dissapears.
    >
    > I will try to explain better..
    >
    > If I use a query like
    >
    > $result = mysql_query("En ter Array Query Here");
    > while ( $row = mysql_fetch_arr ay($result) )
    > {
    > ENTER CODE HERE
    > }
    >
    >
    > The block does not show up (I KNOW the query and code is good because it
    > works on a seperate page)
    >
    >
    > However, queries like the following do work
    > $query = mysql_query("EN TER QUERY HERE");
    > $result = mysql_result($q uery, 0, 0);
    >
    > Basically.. as soon you use a query with the line of "while ( $row =
    > mysql_fetch_arr ay($result) )" the block does not show up anymore. As I
    > said before, I know the query is good and it works, cause I have tested it
    > on seperate pages and have even used the most basic of queries.
    >
    > When I say dissapear.. I do mean exactly that. If you use the 2nd query
    > that I posted.. you can see the block on the front page. As soon as I
    > change it to the other kind of query the block dissapears and is no longer
    > visable.
    >
    > Anyone have any ideas? Or maybe have another way that I can accomplish[/color]
    the[color=blue]
    > query that I am trying to get without using hte "while.." line?[/color]
    Basically[color=blue]
    > I am trying to get FirstName, LastName and SUM(Posts) out of a table and
    > sort them by SUM(Posts), keeping the top 3
    >
    > Thanks
    >
    >[/color]


    Comment

    • Cliff Roman

      #3
      Re: PHP Block in Post Nuke - Problem

      In Postnuke?

      I have tried it on all 3 of my Postnuke sites and as soon as I do any query
      like that the block dissapears.

      I am stumped.. Guess I will just work around it and store temp results in
      the database and call them out

      "Charles E. Pelkey" <cpelkey@charte r.net> wrote in message
      news:vjenrrgg11 gtda@corp.super news.com...[color=blue]
      > Have added any sql error checking??
      > Use the mysql_error( ) function to retrieve any errors between the query,
      > the fetch_array and the display of the rows.
      > The syntax you show in your examples is commonly used, and I for one can[/color]
      not[color=blue]
      > duplicate your problem using your example.
      >
      > -Charles
      >
      > "Cliff Roman" <cliff@nospam.t heromans.us> wrote in message
      > news:BctZa.1136 37$o%2.49314@sc crnsc02...[color=green]
      > > I have been trying to find the answer on the postnuke forums and I have[/color]
      > even[color=green]
      > > tried Sitepoint but I am unable to find an answer. So now I am asking[/color]
      > here[color=green]
      > > in hopes that someone may have an idea
      > >
      > >
      > > I am trying to put a query in a PHP block. However, when I do.. the[/color][/color]
      block[color=blue][color=green]
      > > dissapears.
      > >
      > > I will try to explain better..
      > >
      > > If I use a query like
      > >
      > > $result = mysql_query("En ter Array Query Here");
      > > while ( $row = mysql_fetch_arr ay($result) )
      > > {
      > > ENTER CODE HERE
      > > }
      > >
      > >
      > > The block does not show up (I KNOW the query and code is good because it
      > > works on a seperate page)
      > >
      > >
      > > However, queries like the following do work
      > > $query = mysql_query("EN TER QUERY HERE");
      > > $result = mysql_result($q uery, 0, 0);
      > >
      > > Basically.. as soon you use a query with the line of "while ( $row =
      > > mysql_fetch_arr ay($result) )" the block does not show up anymore. As I
      > > said before, I know the query is good and it works, cause I have tested[/color][/color]
      it[color=blue][color=green]
      > > on seperate pages and have even used the most basic of queries.
      > >
      > > When I say dissapear.. I do mean exactly that. If you use the 2nd query
      > > that I posted.. you can see the block on the front page. As soon as I
      > > change it to the other kind of query the block dissapears and is no[/color][/color]
      longer[color=blue][color=green]
      > > visable.
      > >
      > > Anyone have any ideas? Or maybe have another way that I can accomplish[/color]
      > the[color=green]
      > > query that I am trying to get without using hte "while.." line?[/color]
      > Basically[color=green]
      > > I am trying to get FirstName, LastName and SUM(Posts) out of a table and
      > > sort them by SUM(Posts), keeping the top 3
      > >
      > > Thanks
      > >
      > >[/color]
      >
      >[/color]


      Comment

      Working...