matthewhaworth Posted August 23, 2007 Share Posted August 23, 2007 Lol, review your code completely. Rewrite it maybe. 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!!!! 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. 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 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. 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
Archived
This topic is now archived and is closed to further replies.