Skip to content

Instantly share code, notes, and snippets.

@ryarwood
Last active December 13, 2015 18:28
Show Gist options
  • Save ryarwood/4955240 to your computer and use it in GitHub Desktop.
Save ryarwood/4955240 to your computer and use it in GitHub Desktop.
Get next row for mysql query.
<?php
/* outputs array */
$query = "SHOW TABLE STATUS LIKE 'tablename'";
$result = mysql_query($query);
$row = mysql_fetch_assoc($result);
var_dump($row);
/* outputs number maybe :( */
$r = mysql_query("SHOW TABLE STATUS LIKE 'table_name' ");
$row = mysql_fetch_array($r);
$Auto_increment = $row['Auto_increment'];
mysql_free_result($r);
?>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment