<?php function status($value) { $res=mysql_query("SELECT `status_name` FROM `status`"); echo "<select name='status'>"; while($row=mysql_fetch_assoc($res)) { foreach($row as $a) { echo "<option value='".$a."'"; if($value==$a) { echo 'selected'; } echo ">".$a."</option>"; } } echo "</select>"; } function emploe($value) { $res=mysql_query("SELECT `emploe_name` FROM `emploe` WHERE `emploe_role`='user'"); echo "<select name='emploe'>"; while($row=mysql_fetch_assoc($res)) { foreach($row as $a) { echo "<option value='".$a."'"; if($value==$a) { echo 'selected'; } echo ">".$a."</option>"; } } echo "</select>"; } function pre_show_table() { $res=mysql_query("SELECT `project_id`,`project_name`,`date_start`,`date_finish` FROM `projects`"); echo "<table >"; echo "<tr ><td>Project Name</td><td>Date Start</td><td>Date Finish</td><td>Select</td></tr>"; while($row=mysql_fetch_assoc($res)) { echo '<tr> <td>'.$row['project_name'].'</td> <td>'.$row['date_start'].'</td> <td>'.$row['date_finish'].'</td> <td><input type="radio" name="project_select" value="'.$row['project_id'].'"/></td> </tr>'; } echo "</table>"; } function admin_show($id) { echo "<table border='1'>"; echo "<tr > <td>Project Name</td> <td>Date Start</td> <td>Date Finish</td> <td>TZ</td> <td>TZ Status</td> <td>Design</td> <td>Design Status</td> <td>Verstka</td> <td>Verstka Status</td> <td>Proger</td> <td>Proger Status</td> <td>Sdacha</td> </tr>"; $res=mysql_query("SELECT * FROM `projects` WHERE `project_id`='".$id."'"); $row=mysql_fetch_assoc($res); { echo '<tr> <td>'.$row['project_name'].'</td> <td>'.$row['date_start'].'</td> <td>'.$row['date_finish'].'</td> <td>'.emploe($row['TZ']).'</td> <td>'.status($row['TZ_st']).'</td> <td>'.emploe($row['designer']).'</td> <td>'.status($row['designer_st']).'</td> <td>'.emploe($row['verstka']).'</td> <td>'.status($row['verstka_st']).'</td> <td>'.emploe($row['proger']).'</td> <td>'.status($row['proger_st']).'</td> <td>'.status($row['Sdacha']).'</td> </tr>'; } echo "</table>"; } admin_show(6); ?> 

The admin_show function admin_show not draw in the table, the emploe() and status() functions are called. Who can, tell me, please.

    1 answer 1

    Do you have an error here?

     ="" echo="" 'selected';="" }="" echo="" "=""> 

    After echo, do not put the = sign. This is not the only place with a similar situation.

    In addition to all the functions admin_show there is still such a problem. In line

      $row=mysql_fetch_assoc($res); 

    You have lost the word while . It must be something like:

     While($row=mysql_fetch_assoc($res)) { 

    In general, in your place, I would have thought that the whole code should be rewritten in a new way. And then, as the logic is not clear ...