note 31118 added to function.mysql-field-flags

From: Date: Thu, 10 Apr 2003 09:20:32 +0000
Subject: note 31118 added to function.mysql-field-flags
Groups: php.notes 
Request: Send a blank email to php-notes+get-46444@lists.php.net to get a copy of this message
Another examples : #################################### function field_keys($host, $user, $password, $database, $field ) { $db_link = mysql_connect($host, $user, $password) or die ("error connect"); mysql_select_db($database,$db_link); $query="DESC $field"; $results=mysql_query($query); $i=0; while ($row=mysql_fetch_array($results)) { if ($row[Key]=="PRI") { $array_keys[$i]=$row[Field]; } $i++; } return $array_keys; } #################################### //Example of Main... $tmp = field_keys("localhost", "myuser", "mypassword", "mydb", "field_name" ); // ...loop through array... foreach ( $tmp as $array_tmp){ print "<br>"; print $array_tmp; print "<br>"; } -- http://www.php.net/manual/en/function.mysql-field-flags.php http://master.php.net/manage/user-notes.php?action=edit+31118 http://master.php.net/manage/user-notes.php?action=delete+31118 http://master.php.net/manage/user-notes.php?action=reject+31118

« previous php.notes (#46444) next »