PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!
Ive made a page to enter a news article in to a database. I also need to pull out building names from the second database into a select box so the articles and the buildings are linked. Ive tried using the below but it just comes up blank.
i did print query to make sure it was pulling it out ok, it is connecting ok, i think i have just done the select code wrong, im still new to php and its more the trial and error way.
that doesn't set $buildingname. you need to fetch (hint) the records, then you'll have access to the name (depending on how you fetch and extract the row)
you'll need a while/for/do loop, and I'd suggest using [php_man]mysql_fetch_assoc[/php_man] instead of result.. or at the least, make sure you quote your literal strings.