fer0an Posted October 17, 2010 Share Posted October 17, 2010 hello I'm using this code: $query="SELECT * FROM `second_content` WHERE CHANGED =0 limit 0,1"; to query first row data when I want see it and echo it I recived : Resource id #2 can anyone help me ? thank you Link to comment https://forums.phpfreaks.com/topic/216059-mysql-query-result/ Share on other sites More sharing options...
jl5501 Posted October 17, 2010 Share Posted October 17, 2010 What code are you executing after setting up that query variable? Are you connecting to a database? what code is returning the error? Link to comment https://forums.phpfreaks.com/topic/216059-mysql-query-result/#findComment-1122907 Share on other sites More sharing options...
eran Posted October 17, 2010 Share Posted October 17, 2010 mysql_query() returns a resource if the query was successful. To get database rows, you need to use fetch function such as mysql_fetch_assoc() on the result $result = mysql_query($query); i($result) { $row = mysql_fetch_assoc($result); } http://php.net/manual/en/function.mysql-fetch-assoc.php Link to comment https://forums.phpfreaks.com/topic/216059-mysql-query-result/#findComment-1122909 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.