note 60616 deleted from function.mysql-field-len by betz
| From: | betz@php.net | Date: | Thu, 12 Jan 2006 14:10:52 +0000 |
| Subject: | note 60616 deleted from function.mysql-field-len by betz | ||
| References: | 1 | Groups: | php.notes |
| Request: | Send a blank email to php-notes+get-101629@lists.php.net to get a copy of this message | ||
Note Submitter: Patrick
----
The example over there is wrong.
In the first example someone coppied an wrong function in line 9 _mysql_fetch_len()_
This will be correct:
<?php
$result = mysql_query("SELECT id,email FROM people WHERE id = '42'");
if (!$result) {
echo 'Abfrage konnte nicht ausgeführt werden: ' . mysql_error();
exit;
}
// Liefert die Länge des Wertes in email, zum Beispiel
// würde user@example.com die Länge von 16 ergeben
$length = mysql_field_len($result, 'email');
echo $length;
?>