Category Archive for: Connecting PHP to MySQL

Building a Basic SQL Query Runner

Now that you can connect to SOL, you’re ready to take on something more ambitious: building your own version of a MySOL command-line tool. Of course, you’re a PHP developer and programmer now, so mentally scratch out “command-line” and replace it with “web-based.” It turns out that you already have most of the tools you need. You can…

Read More →

Cleaning Up Your Code with Multiple Files

Even if you don’t realize it yet, there’s something problematic about the script you created in the previous section. Look at the first few MySQL calls you make <?php mysql_connect(“your.database. host” , “your-username”, “your-password”) or die(“<p>Error connecting to database: ” mysql_error() . “</p>”); echo “<p>connected to MySQL!</p>”; mysql_select_db(“your-database-name”) or die(“<p>Error selecting the database your-database-name: ”…

Read More →

Connecting PHP to MySQL

Now that you’ve seen a bit of the power of PHP and MySQL, it’s time to bring these two juggernauts together, With many programming languages, any time you want to interact with a database, you have to download and install extra code or small plug-ins, PHP isn’t like that, though; it comes ready to connect to MySQL from…

Read More →

Back to Top