php on win 2k

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
okee
Forum Newbie
Posts: 5
Joined: Thu Jan 16, 2003 4:48 pm

php on win 2k

Post by okee »

when i type in the address of my website locally i am given a list of the files in the folder, how do i get apache to automatically display index.php ?

also this is a very long shot but

I'm using some third party software for a property website
When i upload it to my webspace (which is linux) it works fine.
when running it locally on win2k the main problem is when I view the houses say 10 per page, if i click on any of the houses to view its full details i get the following errors

Warning: mysql_num_rows(): supplied argument is not a valid MySQL result resource in c:\apache group\apache\htdocs\propertyweblite\propview.php on line 32

THe info abot listings per page etc appear here and then the turn image off/on and then theres another error

Warning: mysql_fetch_array(): supplied argument is not a valid MySQL result resource in c:\apache group\apache\htdocs\propertyweblite\propview.php on line 122

line 32 is> $num_rows = mysql_num_rows($result);

line 122 is> while ($a_row =mysql_fetch_array ($result) )

i know it's very vague :) but
any help would be greatly appreciated.

thanks

okee
User avatar
volka
DevNet Evangelist
Posts: 8391
Joined: Tue May 07, 2002 9:48 am
Location: Berlin, ger

Post by volka »

for your first question take a look at http://httpd.apache.org/docs-2.0/mod/mo ... ctoryindex

for your second, try to change your script to something like

Code: Select all

<?php
$dbConn = mysql_connect( ... ) or die (mysql_error());
mysql_select_db( ... , $dbConn) or die (mysql_error());

$query = ... ;
$result = mysql_query($query, $dbConn) or die( $query . ': ' . mysql_error());
...
?>
see also:
http://php.net/mysql_error
http://php.net/language.operators.errorcontrol
Post Reply