';
echo '
spare_part: ';
echo '
nowrap="nowrap">';
while($row = mysql_fetch_object($result))
{
echo '' .
$row->name . ' ';
}
}
else
{
echo 'Nisu pronadeni podaci o rezervnim djelovima!';
}
?>
Quantity:
value="">
$query = 'SELECT name FROM spare_part ';
$result = mysql_query($query) or die ('Greska u upitu!');
if(mysql_num_rows($result) > 0)
{
echo '';
echo ' ';
echo '
nowrap="nowrap">';
while($row = mysql_fetch_object($result))
{
echo '' .
$row->name . ' ';
}
}
else
{
echo 'Nisu pronadeni podaci o rezervnim djelovima!';
}
?>
value="">
$query = 'SELECT name FROM spare_part ';
$result = mysql_query($query) or die ('Greska u upitu!');
if(mysql_num_rows($result) > 0)
{
echo '';
echo ' ';
echo '
nowrap="nowrap">';
while($row = mysql_fetch_object($result))
{
echo '' .
$row->name . ' ';
}
}
else
{
echo 'Nisu pronadeni podaci o rezervnim djelovima!';
}
?>
value="">
$query = 'SELECT name FROM spare_part';
$result = mysql_query($query) or die ('Greska u upitu!');
if(mysql_num_rows($result) > 0)
{
echo '';
echo ' ';
echo '
nowrap="nowrap">';
while($row = mysql_fetch_object($result))
{
echo '' .
$row->name . ' ';
}
}
else
{
echo 'Nisu pronadeni podaci o rezervnim djelovima!';
}
?>
value="">
$query = 'SELECT name FROM spare_part';
$result = mysql_query($query) or die ('Greska u upitu!');
if(mysql_num_rows($result) > 0)
{
echo '';
echo ' ';
echo '
nowrap="nowrap">';
while($row = mysql_fetch_object($result))
{
echo '' .
$row->name . ' ';
}
}
else
{
echo 'Nisu pronadeni podaci o rezervnim djelovima!';
}
?>
value="">
MySql tables look like this:
Baza: `servis`
CREATE TABLE `check` (
`check_id` int(10) unsigned NOT NULL auto_increment,
`fname` varchar(35) NOT NULL default '',
`lname` varchar(35) NOT NULL default '',
`adress` varchar(60) NOT NULL default '',
`garancy` binary(1) NOT NULL default '0',
`check_number` int(11) NOT NULL default '0',
`date_number` date NOT NULL default '0000-00-00'
PRIMARY KEY (`check_id`)
) ENGINE=InnoDB;
CREATE TABLE `check_spare` (
`check_id` int(10) NOT NULL default '0',
`spare_part_id` int(11) NOT NULL default '0',
`quantity` int(100) NOT NULL default '0'
PRIMARY KEY ('check_id`)
PRIMARY KEY (`spare_part_id `)
) ENGINE=InnoDB;
CREATE TABLE `spare_part` (
`spare_part_id` int(10) NOT NULL auto_increment,
`name` varchar(100) NOT NULL default '',
`price` int(11) NOT NULL default '0',
`description` varchar(255) default NULL,
PRIMARY KEY (`spare_part_id`)
) ENGINE=InnoDB;
What I don't know is how and where do I insert this selected values to be
able to show them latter with some kind of select query. I was working with
ms access and in it this table 'check_spare' should be looking something
like this:
Check_id spare_part_id quantity
3 part 1 2
3 part 2 1
3 part 3 4
3 part 4 1
3 part 5 2
If someone can help me or know where can I find some similar example I would
be thankful!
Zoran
Re: saving multiple data... am 23.02.2006 12:09:10 von Jim Michaels
"Zoran" wrote in message
news:do9i3o$ahi$1@bagan.srce.hr...
> This is my problem:
>
> In my form I have this five option menus (they are all taking values from
> the same table) and one text field for each option menu (it should be
> working something like datasheet in MS ACCESS):
>
why not turn that code into a function and reuse it easily?
and nowrap doesn't need a value.
you also forgot the . the
is supposedly optional.
you also needed to modify your query to include the extra column..
you can even put in some extra code to make the first option SELECTED (also
doesn't need a value).
you *probably* shouldn't use the same field name for the elements.
otherwise, you'll have to access them as an array like
$_POST['thisSpare_partField'][0].
has been deprecated. use instead. actually, if
you can, specify the attribute in the td tag style="font-weight:bold;" or
just use th instead of td.