Sorry its a lame title. Not sure really if this should be hear or over in the sql section. I know what I want to do but I'm blanking on how exactly to go about it. I'm inserting book titles into a library database and what I'd like it to do is search to make sure the author isn't all ready in the author table, if it isn't found it should pop up and ask if they want to create a bio for the author. If they click yes a text area would appear upon hitting okay the author name and bio would be inserted into the author table. If they click no at the bio prompt it should insert the author name and null for the bio.
$aSearch="select aname from authors where aname = '$author'";
$aSearchResult=@mysql_query($aSearch) or die(@mysql_error());
if($aSearchResult != $author){
//pseudo code
pop up message "do you want to enter bio"
if(ok)
$bio = text from text area
insert into author (aname, abio) values ('$author', $'bio);
else
insert into author (aname, abio) values ('$author', 'NULL);
}