By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
438,664 Members | 1,656 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 438,664 IT Pros & Developers. It's quick & easy.

PHP Block in Post Nuke - Problem

P: n/a
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("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 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
Jul 16 '05 #1
Share this Question
Share on Google+
2 Replies


P: n/a
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" <cl***@nospam.theromans.us> wrote in message
news:BctZa.113637$o%2.49314@sccrnsc02...
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("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 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

Jul 16 '05 #2

P: n/a
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" <cp*****@charter.net> wrote in message
news:vj************@corp.supernews.com...
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" <cl***@nospam.theromans.us> wrote in message
news:BctZa.113637$o%2.49314@sccrnsc02...
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("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

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


Jul 16 '05 #3

This discussion thread is closed

Replies have been disabled for this discussion.