Welcome to the Treehouse Community

Want to collaborate on code errors? Have bugs you need feedback on? Looking for an extra set of eyes on your latest project? Get support with fellow developers, designers, and programmers of all backgrounds and skill levels here with the Treehouse Community! While you're at it, check out some resources Treehouse students have shared here.

Looking to learn something new?

Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and join thousands of Treehouse students and alumni in the community today.

Start your free trial

PHP

Andrew Elliott
Andrew Elliott
3,306 Points

mysqli_num_rows brings up blank page?

I am trying tk create a feature in my registration system that checks for usernames that are taken, but whenever I test it with a taken username it redirects to a blank page.

code

Zac Mazza
Zac Mazza
5,867 Points

Hello Andrew,

The code looks right, but I would ensure you are receiving exactly what you are expecting to receive. I would suggest utilizing the following code to verify what is being passed during form processing:

echo "<pre>";
      echo "POST data: <br/>";
     print_r($_POST);
     echo "<br/><br/>GET data: </br/>";
     print_r($_GET);
echo "</pre>";

I suspect the GET data isn't coming through as suspected. Please post the results and I can assist with troubleshooting further.

Thanks and good luck,

Zac

Andrew Elliott
Andrew Elliott
3,306 Points

Thanks for the help but I already had help from my friend. Turned out to be exiting the code every time it didn't work. Thanks again!