Jump to content

Check if a record matches


jeff5656

Recommended Posts

Hello.  I want to check to see if a record matches based on a field.  So I have this:

 

include "connectdb.php";
$consultsq2 = "SELECT * FROM members WHERE username= '" . $_POST['myusername'] . "'";
$result2 = mysql_query ($consultsq2) or die ("Invalid query: " . mysql_error ());
$row2 = mysql_fetch_array ($result2);

 

What code do I write to see if it exists?  Such as "if there is such a record, do this..."

Thanks!

Link to comment
https://forums.phpfreaks.com/topic/173693-check-if-a-record-matches/
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.