Jump to content
php.lv forumi

Problemas =/


Mikijs

Recommended Posts

$user_id = Lietotaja ID numurs

$text6 = "Iesūtne";

			  <select name='mbox_id'>
		  <?
		  $mbox=pg_query("SELECT * FROM tblmailboxes WHERE user_id='$user_id'");
		  while($mbox=pg_fetch_array($mbox)){
		  print "<option value='".$mbox['mbox_id']."'>".$mbox['mboxname']."</option>";
		  }
		  if($mbox_id=="INBOX") { 
			$mbox_id=$text6;
			print "<option value='INBOX' selected>$mbox_id</option>";
		  } else {
			print "<option value='INBOX'>$text6</option>";
			$sqlinput=pg_query("SELECT * FROM tblmailboxes WHERE user_id='$user_id'");
			while($mbox=pg_fetch_array($sqlinput)){
			  if($mbox['mbox_id']==$mbox_id){$prints=" selected";}else{$prints="";}
			  echo "<option value='".$mbox['mbox_id']."'$prints>".$mbox['mboxname']."</option>";
			}
		  }
		  ?> 
		  </select> mapē!

Problēma ir tā ka vinjs man izdod tikai 2 mapes

1. $text6 (Iesūtne)

un

2. Melnraksti

 

bet

mbox_id | user_id |  mboxname  | mbox_type |   testit
---------+---------+------------+-----------+------------
     10 |       1 | Melnraksti |       101 | Melnraksti
      9 |       1 | Izsūtne   |         1 | Izsūtne
(2 rows)

Edited by Mikijs
Link to comment
Share on other sites

iznjemot ara INBOX jeb $text6 izvada 1 ierakstu, jo INBOX ierakstu pats es uzrakstu.

			 if($mbox_id=="INBOX") {
			$mbox_id=$text6;
			print "<option value='INBOX' selected>$mbox_id</option>";
		  } else {
			print "<option value='INBOX'>$text6</option>";

Edited by Mikijs
Link to comment
Share on other sites

×
×
  • Create New...