#1
  1. No Profile Picture
    Junior Member
    Devshed Newbie (0 - 499 posts)

    Join Date
    May 2000
    Posts
    23
    Rep Power
    0
    I have the following code:

    $result = mysql_query("SELECT * FROM images WHERE(topic='$topic')",$db);

    $myrow = mysql_fetch_array($result);

    do {
    printf("<a href="%s?imageid=%s"><img src="%s/%s-t.jpg"></a>n",
    'edit_image_info.phtml', $myrow["imageid"], $myrow["dirname"], $myrow["imagename"]);
    } while ($myrow = mysql_fetch_array($result));

    echo "<br><form action='topic_update.phtml' method='post'>
    <br>Change Topic for This Entire Group of Images:<br>
    <input type='text' name='newtopic' size=40 value=$topic>
    <input type='hidden' name='dirname' value='$dirname'>
    <input type='submit' value='Update'><br></form>";

    } else {
    // no records to display
    echo "";
    }
    *******************************************8
    My problem, is that I am not certain how to define the variable $dirname as referenced in the form as a hidden element. I have attemtped to define it as $myrow["dirname"], which I thought was correct, however this did not work... Any help on this matter would be greatly appreciated...

    Thanks!!!

    Dale.
  2. #2
  3. No Profile Picture
    Contributing User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Oct 1999
    Location
    SLC, UT, USA
    Posts
    47
    Rep Power
    15
    I'm assuming you have an if statement somewhere that matches the "}else{".

    Aside from that if you have a field named dirname in your images table then it looks as though it should work. You might also look at backticking the rest of the double quotes in the printf statement.

    Goodluck,
    Robman
  4. #3
  5. No Profile Picture
    Contributing User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Oct 1999
    Location
    SLC, UT, USA
    Posts
    47
    Rep Power
    15
    Scratch that part about the backticking. Guess I should have looked a little closer.

Similar Threads

  1. quick mysql/php question
    By mirthika in forum PHP Development
    Replies: 2
    Last Post: February 16th, 2004, 02:15 PM
  2. Quick regex wildcard question.
    By s200 in forum PHP Development
    Replies: 2
    Last Post: February 12th, 2004, 09:09 AM
  3. Newbie table creation question
    By andy collins in forum PostgreSQL Help
    Replies: 3
    Last Post: January 23rd, 2004, 02:27 PM
  4. Java Newbie question
    By S0l0 in forum Java Help
    Replies: 5
    Last Post: January 12th, 2004, 03:38 PM
  5. ok super newbie question
    By SCerviche in forum Flash Help
    Replies: 5
    Last Post: January 11th, 2004, 02:29 PM

IMN logo majestic logo threadwatch logo seochat tools logo