leaboy12 Posted May 5, 2009 Share Posted May 5, 2009 I have this message displayed in my variable that i want to print out. here is my code: //connect to database $myConnection = mysql_connect('41.204.223.132', 'getsmart2', 'xxxxxx'); if (!$myConnection) { die ('could not Connect'.mysql_error($myConnection)); } else { //connection made, do nothing } $sqlQuery; $result; $databaseSchema = 'getsmart_moodle'; $sqlQuery = "SELECT * FROM getsmart_moodle.mdl_assignment_submissions WHERE userid = 799 AND assignment = 2"; $result = mysql_db_query($databaseSchema, $sqlQuery, $myConnection); echo('RESULT: '.$result.'<br />'); *And it echos' out Resource id#41* I am using a mysql db connection Some help would be fantastic Link to comment https://forums.phpfreaks.com/topic/156906-solved-what-is-resource-id-41/ Share on other sites More sharing options...
RussellReal Posted May 5, 2009 Share Posted May 5, 2009 $result is a MySQL Result resource.. how you actually access the data is simple: $row = mysql_fetch_assoc($result); then if u want to see the result do print_r($row); Link to comment https://forums.phpfreaks.com/topic/156906-solved-what-is-resource-id-41/#findComment-826553 Share on other sites More sharing options...
leaboy12 Posted May 5, 2009 Author Share Posted May 5, 2009 Awesome!! thanx so much Link to comment https://forums.phpfreaks.com/topic/156906-solved-what-is-resource-id-41/#findComment-826591 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.