[quote]
WARNING:
PHP 4.3.4 introduced a BUG.
if the DB has: '' (empty string)
this function will return: ' ' (string with 1 space)
see: http://bugs.php.net/bug.php?id=26315
[/quote]
the same version PHP 5.2.0
mssql_fetch_assoc
(PHP 4 >= 4.2.0, PHP 5, PECL odbtp:1.1.1-1.1.4)
mssql_fetch_assoc — Liefert ein assoziatives Array des aktuellen Datensatzes aus dem Ergebnis, das durch die Ergebniskennung bestimmt ist
Beschreibung
array mssql_fetch_assoc
( resource $Ergebniskennung
)
Gibt ein assoziatives Array mit dem abgerufenen Datensatz zurück und rückt den internen Datenzeiger weiter. mssql_fetch_assoc() entspricht dem Aufruf von mssql_fetch_array() mit MSSQL_ASSOC als optionalem zweitem Parameter.
Parameter-Liste
- Ergebniskennung
-
Der Bezeichner des Ergebnisses, das ausgewertet wird. Dieses Ergebnis stammt von einem Aufruf von mssql_query().
Rückgabewerte
Gibt ein assoziatives Array mit dem gelieferten Datensatz zurück oder FALSE, wenn es keinen weiteren Datensatz gibt.
mssql_fetch_assoc
pegas1981
22-May-2007 04:41
22-May-2007 04:41
24-Mar-2007 10:25
regarding 'The 30 character field name limit is still an issue'
Thought about using shorter column names and using the description to give more info regarding the column.
as to the
$result = mssql_query('SELECT articles.id, issues.id FROM articles, issues WHERE articles.pub_date = issues.pub_date');
try this
$result = mssql_query('SELECT articles.id as aid, issues.id as iid FROM articles, issues WHERE articles.pub_date = issues.pub_date');
jbarker at erepublic dot com
24-Jan-2007 09:35
24-Jan-2007 09:35
Beware when using mssql_fetch_assoc() to return data pulled in from joined tables; if the tables have the same column names, the column mentioned last will overwrite the prior one when populating the assoc.
Example:
<?
$result = mssql_query('SELECT articles.id, issues.id FROM articles, issues WHERE articles.pub_date = issues.pub_date');
$record = mssql_fetch_assoc($result);
print_r($record);
/*
Prints:
Array
(
[id] => 123
)
*/
?>
brandonkirsch at uses dot gmail dot domain
11-Dec-2006 10:43
11-Dec-2006 10:43
We are running FreeTDS on a Linux Apache / PHP server and encountered the following error when calling mssql_fetch_assoc()
Fatal error: Call to undefined function mssql_fetch_assoc()
We were confused because *some* of the mssql commands worked, such as mssql_connect and mssql_fetch_array. The trick to make mssql_fetch_assoc() work lies in configuring FreeTDS. We had to change the statement to contain the --enable-msdblib switch:
./configure --enable-msdblib
We then recompiled PHP to include --with-mssql=/path/to/freetds and finally mssql_fetch_assoc() began working properly.
ben at thelocust dot org
03-Nov-2006 12:22
03-Nov-2006 12:22
The 30 character field name limit is still an issue as of PHP 5.1.6, at least running under IIS.
electricsurfer.com
01-Dec-2003 08:38
01-Dec-2003 08:38
WARNING:
PHP 4.3.4 introduced a BUG.
if the DB has: '' (empty string)
this function will return: ' ' (string with 1 space)
see: http://bugs.php.net/bug.php?id=26315
php at electricsurfer dot com
03-Jun-2003 11:34
03-Jun-2003 11:34
WARNING: as of PHP 4.3.2
The keys in the array will only contain the 1st 30 characters of the column name if you have column names longer than that.
