note 84116 added to function.mysql-fetch-assoc

From: Date: Sat, 28 Jun 2008 19:56:33 +0000
Subject: note 84116 added to function.mysql-fetch-assoc
Groups: php.notes 
Request: Send a blank email to php-notes+get-140899@lists.php.net to get a copy of this message
i was wondering if it is possible if you could use an array within the associative array. for example: $myArray[0] = "field1"; $myArray[1] = "field2"; $query= SELECT field1, field2 FROM SomeTable $result = mysql_query($query) or die('crap'); $row = mysql_fetch_assoc($result; $myResult = $row[$myArray[0]]; echo $myResult; ---- Server IP: 69.147.83.197 Probable Submitter: 71.177.134.227 ---- Manual Page -- http://www.php.net/manual/en/function.mysql-fetch-assoc.php Edit -- https://master.php.net/note/edit/84116 Del: integrated -- https://master.php.net/note/delete/84116/integrated Del: useless -- https://master.php.net/note/delete/84116/useless Del: bad code -- https://master.php.net/note/delete/84116/bad+code Del: spam -- https://master.php.net/note/delete/84116/spam Del: non-english -- https://master.php.net/note/delete/84116/non-english Del: in docs -- https://master.php.net/note/delete/84116/in+docs Del: other reasons-- https://master.php.net/note/delete/84116 Reject -- https://master.php.net/note/reject/84116 Search -- https://master.php.net/manage/user-notes.php

« previous php.notes (#140899) next »