Přidat otázku mezi oblíbenéZasílat nové odpovědi e-mailem PHP+MySQL: úprava vlastného skriptu Autá

Neviem ako to máš urobené a už vôbec netuším ako vkladať do comboboxu nové mená ale príklad:

function retrieveQueryType($debug=FALSE) {
# USAGE:
#   retrieveQueryType(TRUE);  -- will die with debug info on failures
#   retrieveQueryType(); || retrieveQueryType(FALSE); -- no debugging (default)
# RETURNS:
#   number of rows if successful
#   0 if no rows selected
#   FALSE if query failed
  $query = "SELECT * FROM CustomersTABLE";
  if($result = mysql_query($query))
  {
    if($success = mysql_num_rows($result) > 0)
    {
      echo "<select name='queryTypeCombo' onchange='submitForm();'>\n";
      echo "<option>-- Please select --</option>\n";
    
      //Now fill the table with data
      while ($row = mysql_fetch_array($result))
      {
        $Customername = $row['Customername'];
        $type = $row['type'];
        echo "<option value='$Customername'>$type</option>\n";
      }
      echo "</select>\n";
    }
    elseif($debug)
    {
      die("retrieveQueryType(): No rows returned by query");
    }
  }
  else
  {
    $success = FALSE;
    if($debug)
    {
      die("retrieveQueryType(): query failed - ".mysql_error());
    }
  }
  return($success);
} 

Reakce na odpověď

1 Zadajte svou přezdívku:
2 Napište svou odpověď:
3 Pokud chcete dostat ban, zadejte libovolný text:

Zpět do poradny