matthewhaworth Posted August 23, 2007 Share Posted August 23, 2007 Lol, review your code completely. Rewrite it maybe. Quote Link to comment https://forums.phpfreaks.com/topic/66281-solved-problem-with-mysql_num_rows/page/2/#findComment-331624 Share on other sites More sharing options...
mwalsh Posted August 23, 2007 Author Share Posted August 23, 2007 Yeah, I'm gonna have to take a fresh look at it in the morning. I'm about to fall asleep right now. Thanks for your help!!!! Quote Link to comment https://forums.phpfreaks.com/topic/66281-solved-problem-with-mysql_num_rows/page/2/#findComment-331626 Share on other sites More sharing options...
matthewhaworth Posted August 23, 2007 Share Posted August 23, 2007 Yeah, I'm gonna have to take a fresh look at it in the morning. I'm about to fall asleep right now. Thanks for your help!!!! Actually, it's not as catastrophic as I first though, just change UPDATE to INSERT. UPDATE overwrites already existent data. Quote Link to comment https://forums.phpfreaks.com/topic/66281-solved-problem-with-mysql_num_rows/page/2/#findComment-331627 Share on other sites More sharing options...
mwalsh Posted August 23, 2007 Author Share Posted August 23, 2007 I agree that's why I was trying to count the rows. If there are more than 0 rows then an Update would be appropriate, otherwise an Insert should be used. The problem is that mysql_num_rows isn't returning the proper number of rows consistently Quote Link to comment https://forums.phpfreaks.com/topic/66281-solved-problem-with-mysql_num_rows/page/2/#findComment-331633 Share on other sites More sharing options...
mwalsh Posted August 23, 2007 Author Share Posted August 23, 2007 The issue was that mysql_num_rows doesn't like having queries that contain both characters and integers fields. Once I changed the integer field type to char it started working. Quote Link to comment https://forums.phpfreaks.com/topic/66281-solved-problem-with-mysql_num_rows/page/2/#findComment-332395 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.