Page 1 of 1

*SOLVED*Parse error: quick help please

Posted: Wed Mar 17, 2004 4:52 pm
by mikegotnaild
The error is line 285. I need this fixed quick. I dont see whats wrong with it. This isnt the whole script because the script is way to long to post.

Code: Select all

<?php
function sql_fetch_row(&$res, $nr=0)
{
global $dbtype;
	switch ($dbtype) {  //this is all i needed

    case "MySQL":
        $row = mysql_fetch_row($res);
        return $row;
    break;;

    case "mSQL":
        $row = msql_fetch_row($res);
        return $row;
    break;;

    case "postgres":
    case "postgres_local":
	if ( $res->get_total_rows() > $res->get_fetched_rows() ) {
		$row = pg_fetch_row($res->get_result(), $res->get_fetched_rows() );
		$res->increment_fetched_rows();
		return $row;
	} else {
		return false;
	}
    break;;

    case "ODBC":
    case "ODBC_Adabas":
        $row = array();
        $cols = odbc_fetch_into($res, $nr, $row);
        return $row;
    break;;

    case "Interbase":
        $row = ibase_fetch_row($res);
        return $row;
    break;;

    case "Sybase":
        $row = sybase_fetch_row($res);
        return $row;
    break;;

    default:
    break;;
    }
}


?>

Posted: Wed Mar 17, 2004 4:55 pm
by markl999
See http://php.net/switch on how to use it

Posted: Wed Mar 17, 2004 4:57 pm
by coreycollins
You did not use a switch/case statment correctly. For an example how to use it look at http://www.php.net/switch. It looks like you only need to add a switch and you should be fine. This is just a quick observation though.

Posted: Wed Mar 17, 2004 4:57 pm
by coreycollins
lol beat me to it.