#1
  1. No Profile Picture
    Contributing User
    Devshed Novice (500 - 999 posts)

    Join Date
    Jun 2002
    Location
    Stevens Point, Wisconsin
    Posts
    623
    Rep Power
    20

    Creating a mysql result?


    I'd like to build one myself from an html table containing records returned:
    Header1 Header2
    Value_1 Value_2

    of course there could be more columns or rows.

    Why do I want to do this? Well, the database that I use can only be accessed from pages that are on the webserver. I send a query to a query page that outputs the results in a table. This way, I can get at that information from any location.

    I would like to be able to use the same code that I use when running pages on the server.
    ..Adding a line like
    if ($_SERVER[HTTP_HOST] != 'www.mysite.com')
    { $result = ExecuteQuery($query);}
    and I would put code into the ExecuteQuery function so that it returned the same variable type as mysql_query().

    Is this possible? Should be, but where would I start?
  2. #2
  3. No Profile Picture
    Contributing User
    Devshed Regular (2000 - 2499 posts)

    Join Date
    Jan 2003
    Location
    No es importante
    Posts
    2,065
    Rep Power
    18
    What exactly are you wanting to do? Create a method? Create a wrapper for mysql_query()? I do not understatnd your question.
  4. #3
  5. No Profile Picture
    Contributing User
    Devshed Novice (500 - 999 posts)

    Join Date
    Jun 2002
    Location
    Stevens Point, Wisconsin
    Posts
    623
    Rep Power
    20
    I don't understand what you don't understand.

    if u have an html table with database results, how can that be converted to a resource type: mysql result.
    Then you could use any operations that you use for other mysql results, such as mysql_fetch_object, mysql_num_rows.
  6. #4
  7. No Profile Picture
    Contributing User
    Devshed Regular (2000 - 2499 posts)

    Join Date
    Jan 2003
    Location
    No es importante
    Posts
    2,065
    Rep Power
    18
    Do you want this resource type to be dynamic or static? Will this resource type only be available to the current user or will this be a server side resource type?
  8. #5
  9. No Profile Picture
    Contributing User
    Devshed Novice (500 - 999 posts)

    Join Date
    Jun 2002
    Location
    Stevens Point, Wisconsin
    Posts
    623
    Rep Power
    20
    static and the current script for the current user.. the same as the normal mysql_query return type.

IMN logo majestic logo threadwatch logo seochat tools logo