|
|
|
| как вносить данные в индексированную таблицу?
какая то кривая фигня...
<?php
include('connect.php');
// $county = country_id
mysql_query("INSERT INTO `city`(`city` ????) VALUES ('".$_POST['city']."'???????????)");
?>
<form action="into.php" method="post">
<input type="text" name="city">
<select><?
$sites = mysql_query("SELECT * FROM `country` ");
while ($row = mysql_fetch_array($sites)) {
echo "<option name='".$row['country_id']."'>".$row['country_name']."</option>";
}
?></select>
<input type="submit" name="go" value="внести">
</form>
|
| |
|
|
|
|
|
|
|
для: davidoff_72
(20.07.2015 в 17:12)
| | а чем отличается индексированная таблица от неиндексированной? | |
|
|
|
|
|
|
|
для: Valick
(20.07.2015 в 19:52)
| | написал вот такое вот, но не работает. не вностится информация
таблица city
id_city smallint(10) unsigned auto_increment
city varchar(25)
country_id tinyint(5) unsigned
таблица: country
country_id tinyint(5) unsigned auto_increment
country_name varchar(255)
<?php
include('connect.php');
$county = $_POST['country_id'];
mysql_query("INSERT INTO `city`(`city`, `country_id`) VALUES ('".$_POST['city']."', '$county')");
?>
<form action="into.php" method="post">
<input type="text" name="city">
<select><?
$sites = mysql_query("SELECT * FROM `country` ");
while ($row = mysql_fetch_array($sites)) {
echo "<option name='".$row['country_id']."'>".$row['country_name']."</option>";
}
?></select>
<input type="submit" name="go" value="внести">
</form>
|
| |
|
|
|