Sarcastic wrote:any ideas why mysqli_connect() would work but mysql_connect() wont?
It may have to do with the number and order of extensions you have loaded. To test this theory, try commenting out all "extension=" lines in your php.ini file except for the 'mysql' extension, restart your webserver, and then try using mysql_connect() again.
Sarcastic wrote:this may be a silly question but with me just learning MySQL, is MySQLi very similar to MySQL in the way the scripts are written?
Well... yes and no. [man]MySQLi[/man] does have procedural-style functions (e.g. [man]mysqli_connect/man, [man]mysqli_query/man, etc.), but there is also an OOP method of using it as well. You'll see this double notation in the manual for the MySQLi functions/methods; one for procedural-style code, and one for OOP-style.
I'd really recommend you find a guide/book/whatever that's up-to-date and specifically talks about MySQLi (vs. MySQL) and PHP5.
tl;dr: Yes, there are similarities between the two libraries, but no, you can't just replace "mysql" with "mysqli" and expect everything to work.