Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 4 of 4
  1. #1
    Regular Coder
    Join Date
    Dec 2007
    Posts
    269
    Thanks
    28
    Thanked 0 Times in 0 Posts

    fetching data using "mysql_fetch_assoc"

    i can fetch data using mysql_fetch_array in SHOW TABLE STATUS command but why can not i fetch data using mysql_fetch_assoc ?



    PHP Code:
    $con mysql_connect("localhost""root""123") or die(mysql_errno()."<br/>"mysql_error());
    mysql_select_db("forum",$con);
    $sql "SHOW TABLE STATUS FROM forum";
    $result mysql_query($sql);
    while (
    $row mysql_fetch_assoc($result)) {    
        echo 
    $row["Name"];
        echo 
    $row["Engine"];
        echo 
    $row["Data_length"];

    how can i fetch table calles user' properties using this parameter
    http://dev.mysql.com/doc/refman/5.0/...le-status.html

  • #2
    Super Moderator Inigoesdr's Avatar
    Join Date
    Mar 2007
    Location
    Florida, USA
    Posts
    3,642
    Thanks
    2
    Thanked 405 Times in 397 Posts
    Quote Originally Posted by zodehala View Post
    how can i fetch table calles user' properties using this parameter
    You can specify the table with the LIKE clause:
    PHP Code:
    // you shouldn't need the "FROM forum" part, but if it doesn't work try adding it before the LIKE
    $sql "SHOW TABLE STATUS LIKE 'user'"

  • #3
    Regular Coder
    Join Date
    Dec 2007
    Posts
    269
    Thanks
    28
    Thanked 0 Times in 0 Posts
    Quote Originally Posted by Inigoesdr View Post
    You can specify the table with the LIKE clause:
    PHP Code:
    // you shouldn't need the "FROM forum" part, but if it doesn't work try adding it before the LIKE
    $sql "SHOW TABLE STATUS LIKE 'user'"

    thanx it runs but i want to do this proccess all tables in db (using SHOW TABLE STATUS command)

  • #4
    Super Moderator Inigoesdr's Avatar
    Join Date
    Mar 2007
    Location
    Florida, USA
    Posts
    3,642
    Thanks
    2
    Thanked 405 Times in 397 Posts
    Your original code should work fine, then.


  •  

    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts
    •