Can you please help me?


#1

I want to use a phpnuke block system…but i can’t figure out how to do it…i have tried about 3 times and I can’t do it…So can you please help me?


#2

The policy at PHP Help is to not assist with scripts such as PHP-Nuke. If you have a coding issue with PHP then ask away.


#3

Im not using Php-Nuke…I want to make a block system like they use in PHP-Nuke…I have tried before but kept getting many errors…and I could not fix them…so I ask again…Can you help me?


#4

Well that is quite different than what you said the first time. Don’t patronize me about misunderstanding, for the fact is I understood properly - you mis-spoke.

Now, if you would care to describe what the PHP block system does, I’m certain I can at least help to set you on the right track.


#5

First I will post the code I have tried to get to work:

<?php 
mysql_connect(localhost   ,my_user,my_password ); 
mysql_select_db(my_database); 
$query = 'SELECT * FROM `columns` WHERE `visible`="yes" and `col`="1"  ORDER BY `position` ASC'; 
$result = mysql_query($query) or die(mysql_error()); 
while($row= mysql_fetch_array($result, MYSQL_ASSOC)){ 
echo '<table cellpadding="0" cellspacing="0" width="100px" class="lcolumn">'; 
echo '<tr>'; 
echo '<td class="column" align="center" height="10pt">'; 
echo ''.$row['header'].''; 
echo '</td>'; 
echo '</tr>'; 
echo '<tr>'; 
echo '<td class="columncontent" align="center">'; 
include(''.$row['file'].''); 
echo '</td>'; 
echo '</tr>'; 
echo '</table>';}; 
mysql_free_result($result); 
mysql_close(); 
?> 

What this does is include a file based on what it pulls from the database. It includes a php script…and it displays the following errors:

Warning: mysql_fetch_array(): 4 is not a valid MySQL result resource in c:documents and settingsharpodesktopwebsitesprojectsgrungeincludesleftcol.inc on line 7

Warning: mysql_free_result(): 4 is not a valid MySQL result resource in c:documents and settingsharpodesktopwebsitesprojectsgrungeincludesleftcol.inc on line 22

So can you help me to get this to work please?


#6

Off the top of my head, the only thing that I can see to mention is that you should change this:
$query = ‘SELECT * FROM columns WHERE visible=“yes” and col=“1” ORDER BY position ASC’;
To this:
$query = ‘SELECT * FROM columns WHERE visible=“yes” and col=“1” ORDER BY position ASC’;


#7

I get this error if i dont have them.

You have an error in your SQL syntax near 'columns WHERE visible="yes" and col="1" ORDER BY position ASC' at line 1

#8

Ah yes, you used a protected name for your table… “columns” lol. Ok, anyway, as I stated, its the only thing I can see. It appears to be something wrong with the database, and the only part of that I can debug is the query. I’ve gotten errors by putting the column/table names in quotes before, so I thought I’d suggest it.


#9

Do you know how they do this in php-nuke?


#10

Well, no, but I can tell you right now that it doesn’t matter - your code should work, in theory. There is some syntactical error, something we don’t see and the machine interprets wrong but not as an ERROR. Likely something in the mysql query.