SitePoint Sponsor

User Tag List

Page 2 of 2 FirstFirst 12
Results 26 to 30 of 30
  1. #26
    Non-Member Kelar's Avatar
    Join Date
    Jul 2001
    Location
    Holland
    Posts
    79
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    My guess is that you get the error because $aid is not assigned a value to. I don't think that this is a known-variable to PHP, so you should give it a value, otherwise PHP won't know what to do with it.

  2. #27
    SitePoint Zealot
    Join Date
    May 2001
    Posts
    141
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    re: $aid

    Hi...I thought that $aid already had a value, namely $author["ID"]?

  3. #28
    Non-Member Kelar's Avatar
    Join Date
    Jul 2001
    Location
    Holland
    Posts
    79
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    I presume that comes out of a MySQL-Database. You should set up your connection, and select the table the Author-ID is in. Then declare your variable to be the Author-ID column. That should work.

  4. #29
    SitePoint Zealot
    Join Date
    May 2001
    Posts
    141
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    //connection established
    $dbcnx = @mysql_connect("localhost", "you", "pass");
    mysql_select_db("rebdotca");

    //variable $authors containing values from the authos table set
    $authors = mysql_query("SELECT ID, last_name, first_name FROM Authors");

    //variable which extracts the values using mysql_fetch_array set
    while ($author = mysql_fetch_array($authors)) {
    $aid = $author["ID"]; //sets $aid to be values from the array $authors as the //while loop runs through all the values
    $alname = $author["last_name"];
    $afname = $author["first_name"];
    echo("<OPTION VALUE='$aid'>$alname $afname\n");
    }

    So you see, all of the things you mentioned are already in the code I posted...unless I am missing something, or misinterpreting what you mean!

    Thanks again,

    -XGuy.

  5. #30
    SitePoint Zealot
    Join Date
    May 2001
    Posts
    141
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    The other error...

    Bad request: probably tried to POST a non-executable
    URL

    This is the error I get whenever I try to add a new article, author, or category to my databse. My Xitami server is running, as is my MySQL server...anyone know what could be going wrong?
    I currently have no entries in my database for any articles, authors, or categories...I should still be able to add the very first ones from my content management system shouldn't I?

    Cheers,

    -XGuy.


Bookmarks

Posting Permissions

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