mysql - Variable changes in PHP -


i need keep variable in long form, don't understand these changes.

my code:

//db connection  $sql = "select * `slevy` 1 "; $result = $conn->query($sql); while ($row = $result->fetch_assoc()) {     $sleva = $row['sleva'];     echo $sleva; } echo "------------".$sleva; 

output is:

99381585659209563465667261720583722336659395405------------659395405 

in body of cycle save $sleva , echo sales, after while cycle $sleva contains last 1 row database.

while ($row = $result->fetch_assoc()) {     $sleva = $row['sleva'];     echo $sleva . '<br>'; } // output like: 993815856<br> 592095634<br> 656672617<br> 205837223<br> 659395405<br> 

you wrote to keep variable in long form. means, probably, save $sleva variable whole string, concatenate sales.

$sleva = ''; while ($row = $result->fetch_assoc()) {     $sleva .= $row['sleva']; }  echo $sleva; // output: 99381585659209563465667261720583722336659395405 

Comments

Popular posts from this blog

jquery - How do you format the date used in the popover widget title of FullCalendar? -

asp.net mvc - SSO between MVCForum and Umbraco7 -

Python Tkinter keyboard using bind -