Jump to content

how to use mysqli_fetch_lengths()


Danny620

Recommended Posts

The Code I Have is This

 

  echo '<h3>Table Name: ',$table,'</h3>';
  
  // Make the query:
  $q = "SHOW COLUMNS FROM $table";
  $r = @mysqli_query ($dbc, $q); // Run the query.
  
  if (mysqli_num_rows($r) > 0) { // Available.
  
    echo '<table cellpadding="0" cellspacing="0" class="db-table" width="100%">';
    echo '<tr><th>Use</th><th>Field</th><th>Type</th><th>Null</th><th>Key</th><th>Default<th>Extra</th><th>Type</th></tr>';
    while($row2 = mysqli_fetch_array ($r, MYSQLI_ASSOC)) {
      echo '<tr><td><input name="" type="checkbox" value="" /></td>';
      foreach($row2 as $key=>$value) {
        echo '<td>',$value,'</td>';
      }
      echo '<td><select name="">
    <option value="1">Input Field</option>
    <option value="2">Textbox</option>
    <option value="3">DropDown List</option>
    <option value="4">Upload File</option>
    <option value="5">Checkbox</option>
  </select></td></tr>';
    }
    echo '</table><br />';
  }
  
}

 

and it outputs like this

 

Use Field Type Null Key Default Extra Type

quote_id int(15) NO PRI auto_increment

 

what i would like to do is get the max lenth like the output above int(15) buy by using mysqli_fetch_lengths()

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.