NYCPHP Meetup

NYPHP.org

[nycphp-talk] question about retrieving records..

Henry Ponce henry at beewh.com
Tue Jun 17 22:57:24 EDT 2003


$q='select * from table where 1=1';    //is the query you write.
$result=mysql_query($q);  //to execute the query

If he uses this:
$row=mysql_fetch_row($result);

.....then he'll access a field by $row[n]

If he uses this:
$row=mysql_fetch_array($result):

....then he'll access a field by $row["field_name"]

Hope it helps!! You don't need to change any config setting to manage this, it 
all depends on the code.

Henry.

On Tuesday 17 June 2003 22:32, Joshua S. Freeman wrote:
> My friend is doing some development on my box.  When he returns a row from
> a query, it isn't coming back as a hash  (i.e. $row['field_name']), but
> only as an array (i.e. $row[n]). He tells me that all versions of php he's
> worked with have done this automatically. Is there some config setting I
> need to change on my system to manage this behavior? ...
>
> TIA,
>
> J.
>
>
>
> --- Unsubscribe at http://nyphp.org/list/ ---

-- 
An. Henry Ponce
Linux Registered User # 303567
Mar del Plata, Argentina
Planeta Tierra




More information about the talk mailing list