note 70100 added to function.mysql-field-table
| From: | spam at blondella dot de | Date: | Tue, 03 Oct 2006 11:09:13 +0000 |
| Subject: | note 70100 added to function.mysql-field-table | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-117977@lists.php.net to get a copy of this message | ||
<?php
/*
this function might help in the case described above :-)
*/
function mysql_field_table_resolve_alias($inQuery,$inResult,$inFieldName) {
$theNameOrAlias = mysql_field_table($inResult,$inFieldName);
//check, if AS syntax is being used
if(ereg(" AS ",$inQuery)) {
//catch words in query
$theWords = explode(" ",ereg_replace(",|\n"," ",$inQuery));
//find the words preceding and following AS
foreach($theWords as $theIndex => $theWord) {
if(trim($theWord) == "AS"
&& isset($theWords[$theIndex-1])
&& isset($theWords[$theIndex+1])
&& $theWords[$theIndex+1] == $theNameOrAlias
) {
$theNameOrAlias = $theWords[$theIndex-1];
break 1;
}
}
}
return $theNameOrAlias;
}
?>
----
Server IP: 217.160.72.57
Probable Submitter: 87.123.47.184
----
Manual Page -- http://www.php.net/manual/en/function.mysql-field-table.php
Edit -- https://master.php.net/note/edit/70100
Del: integrated -- https://master.php.net/note/delete/70100/integrated
Del: useless -- https://master.php.net/note/delete/70100/useless
Del: bad code -- https://master.php.net/note/delete/70100/bad+code
Del: spam -- https://master.php.net/note/delete/70100/spam
Del: non-english -- https://master.php.net/note/delete/70100/non-english
Del: in docs -- https://master.php.net/note/delete/70100/in+docs
Del: other reasons-- https://master.php.net/note/delete/70100
Reject -- https://master.php.net/note/reject/70100
Search -- https://master.php.net/manage/user-notes.php