Hi, I am trying to learn SQL and PHP. I plan on going to college for programming soon. I have been learning from tutorials on the web site tizag.com. Great site and easy to learn from. For the SQL part of the tutorials it uses SQL Server Express 2008. I went to use the information that they taught in the tutorials in my cpanel and found that it did not work. After some studying I figured out that it was a different version so had it's own version of code. Am I correct in this? Don't know what version Gator is running. So was wondering if there was a tutorial that was as easy to understand or a good one for Gators phpmyadmin? Googled but couldn't find one. Any other advice for someone who realy wants to learn sql and php
Every Linux based php setup will be using MySQL or PgSQL and not SQL Server. SQL Server is microsoft software that operates only on windows. Somewhere around 80 - 90% of web servers are linux or other non-windows distros. This is a good resource for learning php - http://www.tuxradar.com/practicalphp. Also, php has improved MySQL functions. These are more efficient and offer an object oriented approach to working with a database. http://www.php.net/manual/en/book.mysqli.php MySQL will be similar to using SQL Server. The queries are slightly different but are easily recognizable. phpmyadmin is the same no matter who it is hosted with. Here's a rough tutorial on how to use it. http://www.reg.ca/faq/PhpMyAdminTutorial.html Generally you would create a database in cpanel. You would then create the tables for your databases in phpmyadmin. Then you need to create a user in cpanel. You use this user to interact with the database in your php code.
Thanks for those links. I am understanding how to write the sql and php codes easily enough. I understand how to create a database and post queeries to it and have them show up in the queery results. What I am not seeing anywhere in any of the tutorials is how to get the queeries to show up on a page. example: If I use a simple php page with the opening and closing tags of php on it and insert the following code it should show up on the page in the browser correct? $sql = "SELECT * FROM memb_info LIMIT 0, 30 "; I cant get this to show on the page. Am I missing a step somewhere? I've also tried it with calling the database as well using use database; above that in the tags.
You need to create a connection to your mySQL database. You will find more information here http://www.w3schools.com/php/php_mysql_connect.asp
Here are my favorite 3 sites: tizag, w3schools and java2s. You can find plenty of tutorials here for both php and MySQL!