SitePoint Sponsor |
|
User Tag List
Results 26 to 30 of 30
-
Jul 20, 2001, 12:21 #26
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.
-
Jul 20, 2001, 19:00 #27
- 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"]?
-
Jul 21, 2001, 02:36 #28
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.
-
Jul 21, 2001, 13:51 #29
- 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.
-
Jul 21, 2001, 13:55 #30
- 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