As first note, thanks for the information. It is painfull that my coding got this bad but I am gratefull for it.
@mac_gyver
I am trying the pdo->quote methode but it doesn't seem to work because the string has a lot of single and double quotes. I known the mysql_escape_string doesn't account the charset but the data is not user inputted. It was the only way I found though to get the script working without setting up an additional db connection (no need for the mysql_connect with the simple function). The mysql functions are how I started with php but I will note that I can erase that out of my mind .
val1 is a string which will almost always contain html code, val2 and val3 are hashes from these strings (I know one hash is enough but I really do not wish to allow a chance for a collision). The tip about the autoincrement was also nice there I am adjusting all my code atm to scrap that out of them.
@psycho
No worries they do have right names here just prefer to be carefull because I know my code is bad and don't want somebody to google my website and suddenly find code scraps. I might try your implode function in order to fix my html like string from value1, it is the main issue