Announcements | Last Post | |
---|---|---|
SoC Curricula | 09/30/2017 01:08PM | |
Demarcation or scoping of examinations and assessment | 02/13/2017 07:59AM | |
School of Computing Short Learning Programmes | 11/24/2014 08:37AM | |
Unisa contact information | 07/28/2011 01:28PM |
Function not returning expected value October 29, 2012 09:44AM |
Registered: 12 years ago Posts: 20 Rating: 0 |
Language: PHPfunction getFriendsById($friends) { $sql="select first_name, last_name from users where user_id =".$friends; $results = mysql_query($sql)or die("Selection Query Failed !!!<br/>".mysql_error()); $friendsNames = array(); while ($row = mysql_fetch_array($results)){ $friendsNames[] = $row[';first_name';].';, ';.$row[';last_name';]; } return $friendsNames; }
Re: Function not returning expected value October 29, 2012 11:07AM |
Admin Registered: 18 years ago Posts: 10,001 Rating: 353 |
Language: PHP$friendsNames = array(); while($row = mysql_fetch_assoc($result)) { $friendsNames [] = $row; }
Re: Function not returning expected value October 29, 2012 11:49AM |
Registered: 12 years ago Posts: 20 Rating: 0 |
Language: PHPfunction getFriendsById($friends) { $sql="select first_name, last_name from users where user_id =".$friends; $results = mysql_query($sql)or die("Selection Query Failed !!!<br/>".mysql_error()); $friendsNames = array(); while ($row = mysql_fetch_assoc($results)){ } return $friendsNames [] = $row; }
Re: Function not returning expected value October 29, 2012 02:17PM |
Admin Registered: 18 years ago Posts: 10,001 Rating: 353 |
Re: Function not returning expected value October 29, 2012 02:28PM |
Registered: 12 years ago Posts: 20 Rating: 0 |
Re: Function not returning expected value October 29, 2012 03:22PM |
Admin Registered: 18 years ago Posts: 10,001 Rating: 353 |
Re: Function not returning expected value October 29, 2012 04:09PM |
Registered: 12 years ago Posts: 20 Rating: 0 |
Re: Function not returning expected value October 30, 2012 09:28AM |
Admin Registered: 18 years ago Posts: 10,001 Rating: 353 |
Language: PHPfunction getFriendsById($friends) { $sql="select first_name, last_name from users where user_id =".$friends; $results = mysql_query($sql)or die("Selection Query Failed !!!<br/>".mysql_error()); //$friendsNames = array(); while ($row = mysql_fetch_array($results)){ echo "<br>Friends with ". $row[';first_name';]. " ".$row[';last_name';]. "<br>"; } //return $friendsNames; }
Re: Function not returning expected value October 31, 2012 11:54AM |
Registered: 12 years ago Posts: 20 Rating: 0 |
Re: Function not returning expected value October 31, 2012 12:30PM |
Admin Registered: 18 years ago Posts: 10,001 Rating: 353 |
Re: Function not returning expected value October 31, 2012 12:36PM |
Registered: 12 years ago Posts: 20 Rating: 0 |