Hi, I will try my best to explain my question. I have a table 'abc' and I want to include queries from column '3' in a php code. I need help please. --------- | 1 | 2 | 3| |--|--|--| | a | b | c | |--|--|--| | d | e | f | |--|--|--|
I'd love to help you but I'm unable to understand the question. Is it a PHP question of a MySQL question you are truly asking?
I don't really understand your question, what is this table storing? HTML, PHP, more SQL queries? You first need to retrieve the data from the table before you can use it... you are querying it without fetching the rows. Example: <?php $query = 'SELECT 1, 2, 3 FROM abc'; $req = mysql_query($query); $row = mysql_fetch_assoc($req); $header='<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head>'.$row['3'] <-------HERE ?> PHP:
You first need to fetch the row which you want to show just as DEACALION has shown how to do it. Secondly you can also use the MYSQL WHERE keyword to limit your query to include only your desired record and not all the records from the data base. Third .$3 won't generate anything in fact using $row['3'] would be more appropriate.