I have a table in a MySQL db with 8,000 records.
All I want is a simple bit of code that searches this db for a value. If it finds it, it outputs "Found". If it doesn't, it outputs "Not found".
Anyone help me with this?
Thanks,
Jon
$q=mysql_query( "SELECT * FROM users WHERE name='superstar' "); if ( $row = mysql_fetch_row( $q ) ) { echo 'found him'; // his values are now in $row, if you wanna proceed here } else { echo 'sorry-not found'; }
That worked. Thanks!