Jump to content
php.lv forumi

Kā pareizi izvilkt ierakstus no DB?


Recommended Posts

Posted (edited)

Visu laiku esmu darījis apmēram šādi

 

$query = "select dats from tabulas where nemt='Ja'";
$result = mysql_query($query);
while($row = mysql_fetch_array($result)){
$rezultats = $row['dats'];
echo  ''. $rezultats .';';}

 

Šādi izvada visu smuki - dats1;dats2;dats3.. utt.

 

 

Bet man tagad vajadzētu to visu, kas tiek izvadīt piešķirt vienam mainīgajam, piemēram, lai

$dati= "dats1;dats2;dats3.. utt."

 

 

Cik saprotu jādarbojas ar masīviem (???), bet kā precīzi to panākt es nezinu...

Edited by rebuilder
Posted (edited)

Nu nekas cits kā mēģināt neatliks, nav bijusi īsti saskare ar šo lietu, tapēc mazliet vēl patumša bilde.

 

Interesanti, bet pie visa vainīgs bija "SEPARATOR ';'" bez tā man visu smuki izvadīja.

Bet problēma atrisināt ;)

Edited by rebuilder

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
×
×
  • Create New...