Page 1 of 1

php on win 2k

Posted: Sun Jun 08, 2003 7:10 am
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

Posted: Sun Jun 08, 2003 2:34 pm
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