| Php Mysql_fetch Functions Script Notes |
Mysql_fetch_assoc: Function reads a record from result set and it returns as an associative array. Each element key is the name of the column.
Mysql_fetch_array: This function reads a record from result set and returns as numeric array and associative array elements.
Mysql_fetch_object: This function reads a record from result set and returns as an object. This object belongs to the std base class.
Php Mysql_fetch Functions Script:
<select>
<?php
mysql_connect("localhost","root","");
$dbs=mysql_list_dbs();
while ($db=mysql_fetch_row($dbs))
{
echo "<option> $db[0]</option>";
}
?>
</select>
<?php
mysql_connect("localhost","root","");
$dbs=mysql_list_dbs();
while ($db=mysql_fetch_row($dbs))
{
echo "<option> $db[0]</option>";
}
?>
</select>
Script 2
<select>
<?php
mysql_connect("localhost","root","");
$dbs=mysql_list_tables("information_schema");
while ($db=mysql_fetch_row($dbs))
{
echo "<option> $db[0]</option>";
}
?>
</select>
<?php
mysql_connect("localhost","root","");
$dbs=mysql_list_tables("information_schema");
while ($db=mysql_fetch_row($dbs))
{
echo "<option> $db[0]</option>";
}
?>
</select>


No comments:
Post a Comment