RE: [PHP] function sql question

From: Date: Sun, 05 May 2002 22:34:51 +0000
Subject: RE: [PHP] function sql question
References: 1  Groups: php.general 
Request: Send a blank email to php-general+get-96172@lists.php.net to get a copy of this message
It will work; you're just doing something wrong. Do you want to fix it, or keep doing it this way? ---John Holmes... > -----Original Message----- > From: John Fishworld [mailto:john@webital.de] > Sent: Sunday, May 05, 2002 10:55 AM > To: holmes072000@charter.net; 'PHP-General' > Subject: Re: [PHP] function sql question > > duh ! > yeah that makes sense ! > but it doesn't work ! > I've no idea why but it refuses to give any information back ! > > I've managed to get round this by now no loger declaring it a function > but just actually requiring it where i need it > > require ("get_city_1.inc"); > print_r(array_values ($city)); > > I've also chopped the return part > and just return the values > > $city[0] = $city_id; > $city_name[1] = $city_name; > > Strange > > > > > return 1; > > > return $city_id; > > > return $cityname; > > > > You can't return 3 values...try returning an array, instead. > > > > $ret[0] = $city_id; > > $ret[1] = $cityname; > > return $ret; > > > > or... > > > > $ret["City_ID"] = $city_id; > > $ret["CityName"] = $cityname; > > return $ret; > > > > ---John Holmes... > > > > >

« previous php.general (#96172) next »