Saturday, 7 May 2011

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>

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>

2 comments:

  1. Below is another picture of Jackson (11 weeks) with Aunt Myra. He's grown so much since she last saw php notes at 3 weeks. Myra had a fun tailgating party at her beautiful Auburn condo before the A-Day game.

    ReplyDelete
  2. sir ... how can we can we get one by one values from database result set by clicking the submit button for every time
    Submitted by swamynar on Tue, 06/14/2011 - 16:46.

    while($rec=mysql_fetch_row($data)) { }
    sir I want to ask that why this one day login because it will be very tedious for us to log in every time means to create new account and login..... plz elaborate .. .
    Registration is only one time you can login no of times
    Once you register you can login with that username and password for ever

    ReplyDelete