Hello. I was just trying to learn php and I can not figure it out for nothing. How does it work? I have been reading all the self help pages from my hosting provider and it just keeps linking me in circles. I have set up "PHP myadmin" which is what came with my hosting. I uploadeda sql file on recipes to my server and saved it in my sql folder. When I go to my php myadmin i dont know how to import it the file to there, or if i have to. And once it is onfile how do you use it. what is the basic concepts. Do I have to create some kind of form to search the data base and show results. I'm completely lost. I'm sure once I learn the main concepts I'll get it but I'm not seeing it anywhere in the self help section provided by my host. Thank you and please help me before i go crazy!
Hehe, PHP is a easy language to learn believe it or not! Did you have MSN or aim? If so add me and i'll get you started on some basic PHP Aim - NeDlOh312 MSN -
Whilst it is somewhat easier than other languages, the ability to pick a programming language up entirely depends on your previous programming experience.
I would suggest the book 'php and mysql for dynamic websites'. Or you can download the scripts from the book here and mess with them to learn.
main principles are as follows: 1) phpmyadmin is used to create/amend/delete (MySQL) database tables and can be used to create/amend/delete data from those database tables. 2) php itself is a prgramming language, and as such is what you use to interpret/query the MySQL database tables. To make use of php, you insert it into the code of a standard webpage. For example, normally on your host you would have an index.html file. This is the first page that the user sees when they go to your domain. You can replace this file with index.php, as assumming your host has got the file heirarchy right, it is then the file that will be loaded when a user goes to your domain, and not the index.html. To create an index.php file, simply open up your index.html file and save it as index.php. Insert into the very top of the file (use notepad, pspad, or some other text editor) the following: <?php ?> PHP: Now, everything you want to add into your doocument that is written in php can be inserted between tags as described above. Note you don't need to insert everything at the top of the page, you simply open the tags and close them as required. ie you want to include a common footer template on your site. At the bottom of the index.php page (And all other pages on your site), something like : <?php include('include-files/page-footer.php'); ?> PHP: would import and replace the above statement with the contents of the file page-footer.php. Therefore you simply have the contents of page-footer.php be along the lines of the following: <?php ?> <a href="blahblahblah">Mysiteusesphp.com</a> PHP: Obviosuly there is a lot to learn about the code to read in database tables and display data, too much for me to describe here, but the above is the basic principle of php.
Thank you all. I think I have figured it out now. One of my problems why I couldnt figure it out on my own, was my host,(yahoo) they do not support very many php scripts. probly less then 25, sad, but I'm now switching my host. thank you all for your input.