coolcat50 0 Report post Posted October 10, 2007 I currently have taught myself PHP using w3schools and I am at the ending of the beginner tutorials. Should I go on to the Advance tutorials or try to learn some more PHP from another site or what.Also, using CPanel on the Wii, how would I link a PHP file to a MySQL database for a comment system. A example code would be sweet. I myself have written a code on paper, but it seems like crap.Thank you. Share this post Link to post Share on other sites
sonesay 7 Report post Posted October 10, 2007 You need to know a few things first before you can start connecting to a mysql database. host, username, password, database name. Once you know that you can set it up with the code below and if all is correct you can execute queries with mysql_query("query goes here", $link); There should be plenty of examples out there just do a search. <?php $db_host = 'localhost'; $db_user = ''; $db_pass = ''; $db_name = ''; // if user has submitted anything then validate. $link = mysql_connect($db_host, $db_user, $db_pass) or die("Could not connect to Database > ". $db_name); mysql_select_db($db_name,$link) or die("Could not find Database > ". $db_name);?> Share this post Link to post Share on other sites
shadowx 0 Report post Posted October 11, 2007 I think the best way to learn, at least for myself, is to do. what i mean is take what you have learned already and make a website with it and when you want to do something and you dont know how to either ask for help or search on the internet, thats what i did and i consider myself a mid-level coder and still learning when i can be bothered!Im not sure if the tutorial you followed included databases but there are really great tutorials on tizag.com, just google "PHP mysql tutorial tizag.com" and you should find some good ones there. sonesay also posted some good code there so try to understand each line of that so you are able to create the code yourself and add or change things Share this post Link to post Share on other sites