Professional Web Applications Themes

mysql_fetch_field - PHP Development

Hi, I cannot use function mysql_fetch_field. In the following code, the call to this function (line 14) seems to abort completely the script and I get *no* output! Thanks for your help! Xavier Perseguers --------- <? error_reporting(E_ALL); $db_paroisse = mysql_pconnect('localhost', 'foo', 'foobar') or trigger_error(mysql_error(),E_USER_ERROR); mysql_select_db('foo', $db_paroisse); $query_reunion = "SELECT * FROM reunions"; $result = mysql_query($query_reunion, $db_paroisse) or die(mysql_error()); $i = 0; while ($i < mysql_num_fields($result)) { echo "Détails sur la colonne $i :<br />\n"; $meta = mysql_fetch_field($result, $i); if (!$meta) { echo "Aucun détail disponible<br />\n"; } echo "<pre> blob: $meta->blob max_length: $meta->max_length multiple_key: $meta->multiple_key name: $meta->name not_null: $meta->not_null numeric: ...

  1. #1

    Default mysql_fetch_field

    Hi,

    I cannot use function mysql_fetch_field. In the following code, the call
    to this function (line 14) seems to abort completely the script and I
    get *no* output!

    Thanks for your help!
    Xavier Perseguers

    ---------
    <?
    error_reporting(E_ALL);

    $db_paroisse = mysql_pconnect('localhost', 'foo', 'foobar') or
    trigger_error(mysql_error(),E_USER_ERROR);
    mysql_select_db('foo', $db_paroisse);

    $query_reunion = "SELECT * FROM reunions";

    $result = mysql_query($query_reunion, $db_paroisse) or die(mysql_error());

    $i = 0;
    while ($i < mysql_num_fields($result)) {
    echo "Détails sur la colonne $i :<br />\n";
    $meta = mysql_fetch_field($result, $i);

    if (!$meta) {
    echo "Aucun détail disponible<br />\n";
    }
    echo "<pre>
    blob: $meta->blob
    max_length: $meta->max_length
    multiple_key: $meta->multiple_key
    name: $meta->name
    not_null: $meta->not_null
    numeric: $meta->numeric
    primary_key: $meta->primary_key
    table: $meta->table
    type: $meta->type
    unique_key: $meta->unique_key
    unsigned: $meta->unsigned
    zerofill: $meta->zerofill
    </pre>";
    $i++;
    }
    mysql_free_result($result);
    ?>
    -----------
    XP Guest

  2. #2

    Default Re: mysql_fetch_field

    I found that a call to this function crashes Apache:

    [Mon Jun 6 10:16:02 2005] [notice] child pid 12545 exit signal
    Segmentation fault (11)

    Any idea?

    Xavier Perseguers
    XP Guest

  3. #3

    Default Re: mysql_fetch_field

    XP wrote: 

    If it may help:

    # apache -version
    Server version: Apache/1.3.33 (Debian GNU/Linux)
    Server built: May 11 2005 09:31:58

    # php -version
    PHP 4.3.10-15 (cli) (built: May 9 2005 08:54:56)
    Copyright (c) 1997-2004 The PHP Group
    Zend Engine v1.3.0, Copyright (c) 1998-2004 Zend Technologies

    # uname -srv
    Linux 2.6.8-2-386 #1 Thu May 19 17:40:50 JST 2005


    Xavier Perseguers
    XP Guest

Similar Threads

  1. #39189 [NEW]: Segmentation fault in mysql_fetch_field function
    By mail_konstantin at bk dot ru in forum PHP Bugs
    Replies: 2
    Last Post: October 18th, 08:19 PM
  2. Replies: 0
    Last Post: October 18th, 07:49 PM

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139