Codeasearch.com - Search your code with us Login | Register | Contact us
  Forums > Php > MYSQL_ASSOC
balaji
Posted on Feb 13, 2009
Join Date: February 2009
Location: India ( chennai )
Posts: 9
 
MYSQL_ASSOC  

what is MYSQL_ASSOC give were should we use it

benaya
Posted on Feb 13, 2009
Join Date: June 2007
Location: India ( Chennai )
Posts: 90
 
RE : MYSQL_ASSOC  

Fetch a result row as an associative array, a numeric array, or both
Returns an array that corresponds to the fetched row and moves the internal data pointer ahead.

Example:
MYSQL_NUM returns a numerically indexed array.
$row = mysql_fetch_array($result, MYSQL_NUM);
echo $row[0];

MYSQL_ASSOC returns an associative array.
$row = mysql_fetch_array($result, MYSQL_ASSOC);
echo $row["student_id"];

MYSQL_BOTH returns both.
$row = mysql_fetch_array($result, MYSQL_BOTH)
echo $row[0]." ".$row["name"];

 Hot Discussion
Go Tech launches Android tablet for Rs 3,999...
Sony targets retailers with quick sales pitches and rew...
Share and discover new activities with Google Schemer...
Samsung gets 9 mn preorders for Galaxy S3: Report...
Google revamps search engine to think like a person...
 
 Discussion Topics
IT News
Php
Javascript
Technology Updates
Asp.Net
MySql
Ajax
Html
Fedora
Software Testing
Asp
Java
General
Flash
Ruby on Rails