Help!<

liunx

Guest
I need help with some PHP/MySQL. I'm making an index page for my site with the member count and stuff like that. My page is located at <!-- w --><a class="postlink" href="http://www.windowsforums.net/index2.php">www.windowsforums.net/index2.php</a><!-- w -->

Attached is my statfile.php file in a txt format where the problem lies.shouldn't the statfile have a .php extension, seeing as how it is PHP code in there?


$result4 = mysql_query($db, "SELECT * FROM $db[prefix]_files ORDER BY file_time DESC", 1);

?
as the error message says - wrong parameter count. It should be:


$result4 = mysql_query("SELECT * FROM $db[prefix]_files ORDER BY file_time DESC", 1);

assuming you are trying to access the DB through link 1.

ideally you should use:


$result4 = mysql_query("SELECT * FROM $db[prefix]_files ORDER BY file_time DESC");

which uses the last opened link to the database.


I reckon this is the root of all the other errors.Originally posted by DA Master
Attached is my statfile.php file in a txt format where the problem lies.

That's why it's a .txt file. The problem is in the mysql_fetch_array.no, the problem is in the query.

read my last post.

sorry - missed that bit about text format, but then I have my pc set up to read php files in ConText anyway.Oh right I think I see the problem, thanks for that Horus. I'll post back.OK made some changes.

<!-- w --><a class="postlink" href="http://www.windowsforums.net/index2.phpwhat">www.windowsforums.net/index2.phpwhat</a><!-- w --> is this

$result4 = mysql_query("SELECT * FROM $db[prefix]_files ORDER BY file_time DESC");

add this into the mix

$result4 = mysql_query("SELECT * FROM $db[prefix]_files ORDER BY file_time DESC");
if(!$result4) {echo mysql_error();}

that will tell you what is wrong with the query.I fixed the $db[prefix] thing, this is the original query from the script and I forgot to change it. And it just says this...

Warning: mysql_fetch_array(): supplied argument is not a valid MySQL result resource in /home/windowsf/public_html/statfile.php on line 51
 
Back
Top