form problem (?)



hello
i have a form with 5 fields. and my problem is that if user put 2 or more
same variables my script finds in db only 1 and i need to search all
variables in db even if they r same.

<http>
<body>
<?php
$A=$_POST['A'];
$u=$_POST['u'];
$B=$_POST['B'];
$w=$_POST['w'];
$C=$_POST['C'];
$x=$_POST['x'];
$D=$_POST['D'];
$y=$_POST['y'];
$E=$_POST['E'];
$z=$_POST['z'];
require("connect.php");
$query ="SELECT matom,nazwa FROM chem WHERE symb LIKE '$A' OR symb LIKE '$B'
OR symb LIKE

'$C' OR symb LIKE '$D' OR symb LIKE '$E'";
$result = mysql_query ($query) or die ("Zapytanie zakonczone
niepowodzeniem");
$wiersze=mysql_num_rows($result);
echo"<br>$wiersze";
for ($i=0;$i<$wiersze;$i++) {
$wiersz = mysql_fetch_array($result);
$a=$wiersz["matom"];
$b=$wiersz["nazwa"];
$tab_b[]=$b;
$tab_a[]=$a;
echo "Masa molowa <b>$b"."u</b> wynosi $a<br>";
}
if(!$u)
$u=1;
if(!$w)
$w=1;
if(!$x)
$x=1;
if(!$y)
$y=1;
if(!$z)
$z=1;

$M=($tab_a[0]*$u)+($tab_a[1]*$w)+($tab_a[2]*$x)+($tab_a[3]*$y)+($tab_a[4]*$z
);
echo "<br>".$M;
mysql_free_result($result);
mysql_close($link);
?>



regards




.



Relevant Pages

  • form (?) problem
    ... same variables my script finds in db only 1 and i need to search all ... '$C' OR symb LIKE '$D' OR symb LIKE '$E'"; ... Prev by Date: ...
    (comp.lang.php)
  • Re: Too many open files - why is this?
    ... ....The script always displays the "Log Closed..." ... closing. ... Regards, ... Prev by Date: ...
    (comp.lang.tcl)
  • Re: Disclaimer with Sink (!!Urgent!!) - a tricky one
    ... Script tells how to do: ... Basically I want to add disclaimer to all messages going to other than ... Regards ... Prev by Date: ...
    (microsoft.public.exchange.admin)
  • Re: 80 character limit
    ... > Does anyone know of any script that either ... Prev by Date: ...
    (comp.editors)
  • Re: Show me your... Logon Script
    ... the script now and see how it goes. ... Regards, ... Euan ... Prev by Date: ...
    (microsoft.public.scripting.vbscript)