Hi,
I have a table called users and it is in that way :

admin      public             id
 abc            a                 1
 acc            ac                2
  a                                  3

now, how i can insert data at the id:3 line for the public only field?
when i try to do it
// $query = "INSERT INTO groupspu (public) VALUES ('kk')";
it moves to id 4,insert there the new value and leaves admin field
empty. so if i want an automated insertion to one of the two fields i
will have continiously and one empty field.
Is there anything i can do about it?

And if not is there any way to avoid printing the empty fields?
I use this :

table width="95%" border="1" cellspacing="0" cellpadding="0"
align="center" bordercolor="#000000">

     <tr bgcolor="#000000">
<td colspan="<?php echo $fields_num; ?>">
            <div align="center"><font size="3" face="Verdana, Arial,
Helvetica, sans-serif" color="#FFFFCC"><b>GROUPS PER USERS</b></font></
div>
          </td>
        </tr>

<tr bgcolor="#CCCCCC">
<?php
        for($i=0; $i<$fields_num; $i++){
        $field = mysql_fetch_field($result);

?>


          <td width="6%">
            <div align="center"><font size="1"><b><font face="Verdana,
Arial, Helvetica, sans-serif"><?php echo "{$field->name}"; ?></font></
b></font></div>
          </td>
         <?php } ?>

<?php

        // printing table rows



        print "<tr>";
$result = mysql_query("SELECT * FROM groupspu");
while($row = mysql_fetch_row($result)){
        foreach($row as $cell) {

        print "  <td width=\"6%\">";
        print "  <div align=\"center\"><font face=\"Verdana, Arial,
Helvetica, sans-serif\" size=\"1\">$cell &nbsp";
        print "</font></div>";

        print "  </td>"; }

        print "</tr>";


        }


?>

but it print and the empty fields..tried to use something like :

                if($cell=="") {}
 else {  }
but couldn't manage it to work.
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"mysql" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to [email protected]
For more options, visit this group at http://groups.google.com/group/mysql
-~----------~----~----~----~------~----~------~--~---

Reply via email to