0

I'm the data with the following code.

$parametre = mysql_query("select * from faturaparametre where musteri='$musteri' and 
urungrubu='$urungrubu' and tasimasekli='$tasimasekli' and donem<= '$tarih' and donem2>= '$tarih' and teslimnoktasi='$teslimnoktasi1' and $agirlik BETWEEN min and max");
while($parametresonuc = mysql_fetch_array($parametre)) {


$fatparametreid = $parametresonuc[id];
$ynadresno = $parametresonuc[yuklemenokta];

Skip this procedure if you do not have the following variables: the next one in the list if there is no break in the last one in the search process, how can I do this?

    $adresil1 = mysql_query("select * from adresler where id='$yuklemenokta'");
$adressonuc1 = mysql_fetch_array($adresil1);


$yuklemeadresno = $adressonuc1[adresno];
$yuklemeil = $adressonuc1[noktail];
$yuklemeilce = $adressonuc1[noktailce];
$yuklemeilb = "il".$yuklemeil;

This code does not run more than one priority finding. and do not find exactly the same thing

if(eregi($ynadresno, "$yuklemeadresno")) {


$ftid = $fatparametreid;


}elseif(eregi($ynadresno, "$yuklemeilce")) {


$ftid = $fatparametreid;


}elseif(eregi($ynadresno, "$yuklemeilb")) {


$ftid = $fatparametreid;


}else {


}
  • 1
    Not the cause of your issue but array keys should be quoted: `$parametresonuc['id'];`. – Jim Aug 08 '13 at 11:18

1 Answers1

0

The array keys should be quoted,

$yuklemeadresno = $adressonuc1['adresno'];
$yuklemeil = $adressonuc1['noktail'];
$yuklemeilce = $adressonuc1['noktailce'];
$yuklemeilb = "il".$yuklemeil;
Optimus Prime
  • 6,817
  • 5
  • 32
  • 60
  • Nope. There's no (major) difference between `elseif` and `else if`. http://stackoverflow.com/questions/4661508/ – Amal Murali Aug 08 '13 at 11:19
  • @AmalMurali Thanks, never knew that :o – Optimus Prime Aug 08 '13 at 11:22
  • Just the quotes, I did not know `elseif` can be used. At @GünaySırbudak – Optimus Prime Aug 08 '13 at 11:23
  • @OptimusPrime: no worries :) – Amal Murali Aug 08 '13 at 11:24
  • Unfortunately, the following code lists all. synchronize exactly what is included in the list needs to be. if(eregi("$ynadresno" , "$yuklemeadresno" )) { $ftid = $fatparametreid; echo"$ftid
    "; }else if(eregi("$ynadresno" , "$yuklemeilce")) { $ftid = $fatparametreid; echo"$ftid
    "; }else if(eregi("$ynadresno" , "$yuklemeilb")) { $ftid = $fatparametreid; echo"$ftid
    "; }else { } }
    – Günay Sırbudak Aug 08 '13 at 11:41
  • @GünaySırbudak No, i edited the answer, the elseif thing won't work, instead quote the keys in the arrays you have used. – Optimus Prime Aug 08 '13 at 11:42
  • Does exactly equating eregi? Does the character, even if in the past? I need a function to find exactly the same. – Günay Sırbudak Aug 08 '13 at 11:46
  • Sorry. I could not understand what are you asking. Array elements should be `$adressonuc1['adresno'];`, you have used `$adressonuc1[adresno];` – Optimus Prime Aug 08 '13 at 11:49
  • I'm with the following query data. results in the from "$ynadresno" area "10500001" in the process, which will have. If you do not pass to the next action. – Günay Sırbudak Aug 08 '13 at 12:17
  • $parametre = mysql_query("select * from faturaparametre where musteri='$musteri' and urungrubu='$urungrubu' and tasimasekli='$tasimasekli' and donem<= '$tarih' and donem2>= '$tarih' and teslimnoktasi='$teslimnoktasi4' and $agirlik BETWEEN min and max"); while($parametresonuc = mysql_fetch_array($parametre)) { $fatparametreid = $parametresonuc['id']; $ynadresno = $parametresonuc['yuklemenokta']; – Günay Sırbudak Aug 08 '13 at 12:18
  • if(eregi("$ynadresno" , "10500001" )) { $ftid = $fatparametreid; echo"$ftid
    "; }else if(eregi("$ynadresno" , "772")) { $ftid = $fatparametreid; echo"$ftid
    "; }else if(eregi("$ynadresno" , "il50")) { $ftid = $fatparametreid; echo"$ftid
    "; }else { } }
    – Günay Sırbudak Aug 08 '13 at 12:19
  • Still don't get what you are asking, are you using a translator? Try `if(eregi($ynadresno , "10500001" ))`. No need to quote variables anywhere. Remove " " around variables. – Optimus Prime Aug 08 '13 at 12:27
  • if you are looking for in the list value($ynadresno) = ($ yuklemeadresno) If you have this line will assign the variable. ($ftid = $ fatparametreid;) – Günay Sırbudak Aug 08 '13 at 12:34
  • I am sorry, i am not able to understand what you are asking. Language problem. – Optimus Prime Aug 08 '13 at 12:46
  • If it is looking for ($yuklemeadresno) in the results($ynadresno) if the value to assign to the variable. – Günay Sırbudak Aug 08 '13 at 13:05