IwnfuM Posted August 29, 2010 Share Posted August 29, 2010 i was trying to getting out 1 field from the db. i was doin it like this . $getout = mysql_query("SELECT `ip` FROM `table` WHERE `time`='".$time."'"); it doesnt getting out what i asked for. can any one help me with this. thanks , Mor. Quote Link to comment https://forums.phpfreaks.com/topic/212000-getting-out-1-field/ Share on other sites More sharing options...
PFMaBiSmAd Posted August 29, 2010 Share Posted August 29, 2010 Time is fairly precise. Are you sure you have a matching row where your time column has a value that exactly matches what is in your $time variable? Generally when trying to match time, you use <, <=, >, or >= comparisons rather than just an = comparison. Quote Link to comment https://forums.phpfreaks.com/topic/212000-getting-out-1-field/#findComment-1104857 Share on other sites More sharing options...
IwnfuM Posted August 29, 2010 Author Share Posted August 29, 2010 i double check it twice. it gives me. "Resource id #" with a number. anyway , if that important i was just echoing the $getout . thanks , Mor. Quote Link to comment https://forums.phpfreaks.com/topic/212000-getting-out-1-field/#findComment-1104880 Share on other sites More sharing options...
PFMaBiSmAd Posted August 29, 2010 Share Posted August 29, 2010 mysql_query() returns a result resource. You must fetch the data from the result resource before you can use it. There is a family of mysql_fetch_xxxx() functions that will let you do that. I recommend reading a basic mysql tutorial or read the examples in the php documentation to learn how to execute a query and fetch the data from the query. Quote Link to comment https://forums.phpfreaks.com/topic/212000-getting-out-1-field/#findComment-1104882 Share on other sites More sharing options...
IwnfuM Posted August 29, 2010 Author Share Posted August 29, 2010 made it . i got 1 more question. what is the difference from Mysql_fetch_array to Mysql_fetch_assoc . thanks , Mor. Quote Link to comment https://forums.phpfreaks.com/topic/212000-getting-out-1-field/#findComment-1104888 Share on other sites More sharing options...
Pikachu2000 Posted August 29, 2010 Share Posted August 29, 2010 PHP Manual Quote Link to comment https://forums.phpfreaks.com/topic/212000-getting-out-1-field/#findComment-1104892 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.