CodeIgniter Forums
Error due to code in Form Vaildation.php - Printable Version

+- CodeIgniter Forums (https://forum.codeigniter.com)
+-- Forum: Using CodeIgniter (https://forum.codeigniter.com/forumdisplay.php?fid=5)
+--- Forum: General Help (https://forum.codeigniter.com/forumdisplay.php?fid=24)
+--- Thread: Error due to code in Form Vaildation.php (/showthread.php?tid=73650)



Error due to code in Form Vaildation.php - Mekaboo - 05-17-2019

Hello!

Ive looked and looked but cant seem to find how to correct issue that comes with this line of code:

 return $query->num_rows() === 0;

Ive seen various ways to correct but dont know which is right. I may have asked of this before or not but if I did please forgive me. Im trying to correct this code because its messing  everything else up Sad  Can  someone help, THANK YOU!!!

Heart Heart ,
Mekaboo


RE: Error due to code in Form Vaildation.php - InsiteFX - 05-18-2019

We need more information then just that.

What error are you getting?

Show the code that is generating the error.


RE: Error due to code in Form Vaildation.php - Mekaboo - 05-18-2019

(05-18-2019, 03:34 AM)InsiteFX Wrote: We need more information then just that.

What error are you getting?

Show the code that is generating the error.

This was my original error:

Fatal error: Call to a member function num_rows() on a non-object in /home4/cultured/public_html/system/libraries/Form_validation.php on line 1122

I thought it was because I didnt have a form vaidation in my library folder. After making one it messed up my login so I took it out. Now I still get this error after trying to test register. How do I fix this? I thought I added the proper links within my autoload and config files, I guess I missing something else. Thank you for the help Smile


RE: Error due to code in Form Vaildation.php - php_rocs - 05-18-2019

@Mekaboo,
Try this instead:

Return ($query->num_rows() === 0)? 0 : $query->num_rows();

Also, you might want to see what value $query->num_rows() is putting out. Do an echo statement. Also, Xdebug might be helpful as well.


RE: Error due to code in Form Vaildation.php - Mekaboo - 05-18-2019

(05-18-2019, 02:00 PM)php_rocs Wrote: @Mekaboo,
Try this instead:

   Return ($query->num_rows() === 0)? 0 : $query->num_rows();

Also, you might want to see what value $query->num_rows() is putting out. Do an echo statement.  Also, Xdebug might be helpful as well.

Thank you so very much Smile