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
https://forums.phpfreaks.com/topic/255319-how-to-use-mysqli_fetch_lengths/
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • 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.