Re: Fetching Data from a Table

From: Date: Wed, 28 Jun 2000 16:12:20 +0000
Subject: Re: Fetching Data from a Table
Groups: php.general 
Request: Send a blank email to php-general+get-3589@lists.php.net to get a copy of this message
Ben, Use substr(), not subst() Carroll Barrett -----Original Message----- From: Ben Ocean <beno@cnw.com> To: php-general@lists.php.net <php-general@lists.php.net> Date: Wednesday, June 28, 2000 11:23 AM Subject: [PHP] Fetching Data from a Table >Hi; >I'm trying to parse birthdata from a string in a table (in form YYY-MM-DD). >I'm using this expression to fetch the data from a table called *horse*: > >$query = "select name, color, gender, birth from horse order by color"; >$result = mysql_query ($query) >or die ("Query failed"); > >then cycling through the data thus: > >while ($row = mysql_fetch_row ($result)) >{ >for ($i = 0; $i < mysql_num_fields ($result); $i++) >{ > >and now here's the problem area: trying to parse the birthdate > >$birthyr = subst($row[birth],0,4); /* calc year of birth */ >$birthmo = subst($row[birth],5,2); /* calc mo. of birth */ >$birthda = subst($row[birth],8,2); /* calc day of birth */ > >I get this error message: > >Fatal error: Call to unsupported or undefined function subst() in >/usr/www/thewebso/httpd/htdocs//Clients/Antigo/Antigo_search.php 3 on line 77 > >line 77 contains $birthyr = subst($row[birth],0,4); >Thanks in advance for any help! >BenO > > >-- >PHP General Mailing List (http://www.php.net/) >To unsubscribe, e-mail: php-general-unsubscribe@lists.php.net >For additional commands, e-mail: php-general-help@lists.php.net >To contact the list administrators, e-mail: php-list-admin@lists.php.net >

« previous php.general (#3589) next »