| 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.theromans.us> wrote in message
news:BctZa.113637$o%2.49314@sccrnsc02...[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("Enter Array Query Here");
> while ( $row = mysql_fetch_array($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("ENTER QUERY HERE");
> $result = mysql_result($query, 0, 0);
>
> Basically.. as soon you use a query with the line of "while ( $row =
> mysql_fetch_array($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] |