Finding the correct syntax for using variables in MySQL can be surprisingly difficult. Once you know it, it's easy. Here's a start:
SET @username := 'jonesr'; SELECT id,fname,lname FROM staff WHERE username = @username;
Comments are closed. You will not be able to post a comment in this post.