I’m writing some code for kids in rural Tanzania to get information sent via text messages. It helps if what I have queried is lumped together as one long string so it is easy to cram into the text. Right now I have an array function which spits it out line by line. How can I create a variable that creates one giant string of all this information? Not sure if the fetch array is the best approach and am stuck. Would the implode function help?
// Creates query based on student input for subject, Form, etc. (didn’t copy this code over)
$query = "select * from civics
where Subject = ‘$subject’
and Form = $Form
and Topic_Number = $Topic_Number
and SubTopic_Number = $SubTopic_Number
and Information_ID = $Information_ID
";
}
// Here’s where I have problems
$result = mysql_query($query) or die(mysql_error());
while($row = mysql_fetch_array($result)) {
echo $row[ ‘Information’];
echo "<br />";
}
}