Ok an SQL injection can look something like this
SELECT * FROM mytable
WHERE username = '''
AND password = ''
"
From that an error will occur as there are 3 single quotes, if an error does occur the attacker can do something like this
';SHOW DATABASES
the code in your query will look like so
SELECT * FROM mytable
WHERE username = '';SHOW DATABASES'
AND password = ''
"
Not protected the user will have a list of all databases on the server under that username, password combination, they can do many things if this is successful such as update a client records password to nothing and enter into that user without requiring a password.
Or more damaging deleting all data in the database.
How to fix this you can use a quite a few things
Firstly make sure magic_quote_gpc is off if not do a search i have placed a function on how to fix that.
From there you can use addslashes(), mysql_escape_string
From there you should probably read up on this link http://www.owasp.org/ at the moment they are fixing there site. But look on it for the top 10 security vunerabilities