Combining 2 statements

I Have the following 2 statements that I need help with to try to combine
[php]<?
$query=“SELECT * FROM programs”;
/* You can add order by clause to the sql statement if the names are to be displayed in alphabetical order /
$result = mysql_query ($query);
echo “”;
// printing the list box select command
while($nt=mysql_fetch_array($result)){//Array or records stored in $nt
echo “$nt[Title]”;
/
Option values are added by looping through the array */
}
echo “”;// Closing of list box
?>[/php]

[php]<?php echo $row_processing['eng_review']; ?>[/php]

What I am needing to do is on my form pull in information from a database entry as well as pulling in a predefined list from a separate table.

this should not work
[php]
echo “”;
[/php]

so i removed the
[php]
echo “”;
[/php]

for the form which contains textbox you do exactly the same except you dont loop because is only one value.

Note: i recommend using mysql_assoc is faster than array since its ur own database you alrdy know the struture

You need to get data from two different tables but your only looking for data in one table ‘programs’

Try something like this

[php]SELECT programs., second_table_name. FROM programs[/php]

Sponsor our Newsletter | Privacy Policy | Terms of Service