The author writes: Whilst working on the automatic production of web statistics - came across the following problem: "How do I get relational data from an Hierarchical structure?" It didn't take long to realize - I'd have to use PHP to talk to LDAP, pull off records & upload into a series of tables, using the cn as primary key. Which then could be queried relationally. Pulling off large, queries and repeatedly transcending LDAP trees is pretty slow - so I built my LDAP to SQL engine, by flattening dns into table names. Then used PHP scripts to query & produce daily snap shots.
In PHP every database is accessed slightly differently. To connect to MySQL, you would use mysql_connect(). When you decide to upgrade to Oracle or Microsoft SQL Server, you would use ocilogon() or mssql_connect() respectively. What is worse is that the parameters you use for the different connect functions are different also.. That's why a database wrapper library such as ADODB comes in handy when you need to ensure portability.
<p>
This tutorial has been translated into multiple languages, including German, Spanish, Polish, Thai and Chinese.
In some content management scripts case one needs to create a database and also populate it (insert the tables from the example .sql file). It's the case of PhpNuke for example.
You will learn here to create a new database in phpmyadmin and also insert the needed information. There are some images too, to help you grasp the info easier.
A collection of 18 FAQs on connecting MySQL server with PHP scritps. Clear explanations and tutorial exercises are provided on MySQL server connection; providing port number, user account and password; selecting or creating database; running SQL statements; checking execution errors.
This tutorial will hopefully teach you some basics of how to access data with your PHP scripting to gather information with in a MySQL database.
The first step you need to do is get a basic understanding of what MySQL is. If your site can handle or has access to a MySQL database you should try using the PHP Myadmin application to help you use and access your MySQL datases fast and easy.
Ever see the little errors of unable to find a file that is stored in mysql? Well you can use this tutorial to add a little message so the viewers know whats going on.
This is the third installment of our php mysql tutorial series. This tutorial covers inserting data to MYSQL with a PHP script. Using the following key features; HTML Forms, Passing variables from a form to php and inserting into the database using Mysql INSERT command.
topics covered,
- mysql connections
- error handling
- listing databases on a server
- listing tables in a database
- printing mysql table fields into table header
- printing the data into the table automatically
why should you look at it?
- no specific fields mentioned, just point the script at a server, db and table and watch it do its thing!
- you get to reuse the code easily
- no functions, includes, api's or anything
- all 100% php + mysql code for beginners
- runs on php4 or php5, with any mysql version
by tss503
Platform(s): Linux, Windows, FreeBSD, Mac OSX, Sun Solaris