Page 1 of 1

Installation script problem

Posted: Fri Oct 29, 2010 1:19 pm
by RedLenin
I am trying to run an installation script which is failing to create any tables in the target database.
I am getting the alert "Notice: Undefined index: reuse" in response to the following line in install.php:

Code: Select all

if ($_POST['reuse']=='true')
And then a whole string of errors relating to line 4 in the following function from install.php:

Code: Select all

function tableExists($tablename) {
	$SQLQuery = "SHOW TABLES";
	$Result = mysql_query($SQLQuery);
	while($Row=mysql_fetch_row($Result)){
		if($Row[0]==$tablename){
			return true;
		}
	}
	return false;
}
This produces the error "Warning: mysql_fetch_row(): supplied argument is not a valid MySQL result resource."

Any ideas, please?

Re: Installation script problem

Posted: Fri Oct 29, 2010 5:52 pm
by califdon
The error message is telling you that there was no such $_POST array element named 'reuse'. You must examine the script that you expected to create that $_POST array. If you continue to have this problem, insert a debugging line near the top of your PHP script:

Code: Select all

  print_r($_POST);
which should print on the screen whatever it found in the $_POST array. If it only prints the word "Array()", the form script is not sending any $_POST data.