How Database from .htaccess to My SQL

Discussion in 'PHP' started by knisarmughal, Nov 1, 2008.

  1. #1
    Hello Friends

    i have database file in .htaccess format i want the convert this file in my sql how is possible please clear to me.

    thanks
     
    knisarmughal, Nov 1, 2008 IP
  2. Calon

    Calon Peon

    Messages:
    25
    Likes Received:
    1
    Best Answers:
    0
    Trophy Points:
    0
    #2
    I don't understand.

    You have a .sql file? and you wish to insert it into your database?
     
    Calon, Nov 1, 2008 IP
  3. Sir P

    Sir P Peon

    Messages:
    76
    Likes Received:
    2
    Best Answers:
    0
    Trophy Points:
    0
    #3
    I'm a bit confused as what the .htaccess is doing too here...

    can you post up your file so maybe we can understand more?

    cheers,
     
    Sir P, Nov 2, 2008 IP
  4. thapame

    thapame Well-Known Member

    Messages:
    739
    Likes Received:
    18
    Best Answers:
    0
    Trophy Points:
    180
    #4
    What’s connection between .htaccess & sql?
    Can you clarify what you want exactly?
     
    thapame, Nov 2, 2008 IP
  5. rohan_shenoy

    rohan_shenoy Active Member

    Messages:
    441
    Likes Received:
    20
    Best Answers:
    0
    Trophy Points:
    60
    #5
    I think I understand what he means:

    Lets assume that he wants http://website.com/php/to entries.php?cat=php

    Now, lets assume that the ID of the category PHP is 3, then instead of directing to entries.php?cat=php, he wants to redirect them to entries.php?cat_id=3.

    So basically, he may be keen on SQL because thats the only way he can get the ID of that category.

    If I am correct in my understanding, I will suggest an workaround to knisar:
    Let the PHP script that receives the redirected user do that task.
    
    <?php
    $category_slug=mysql_real_escape_string($_GET['cat']);
    $sql="SELECT category_id FROM categories_table WHERE category_slug='category_slug'";
    $resource=mysql_query($sql);
    $category_id=mysql_result($resource,0,'category_id');
    //of course you could do it easier using subqueries or joins, but this long-route is just for your understanding!
    ?>
    
    PHP:
     
    rohan_shenoy, Nov 2, 2008 IP