Connect to MySQL
6 posts
Page 1 of 1
The PHP way of connecting to MySQL.

Code: Select all
Have Fun <?php
$db = mysql_connect("mysql server", "username", "password")
or die("Cannot connect to: " . mysql_error());
echo "Succesfully connected to the MySQL Database";
mysql_close($db);
?>

I like to use MySQL.Connector.NET
LINK: http://www.mysql.com/downloads/connector/net/
It is very easy to use, and there is all sorts of example code snippets all over the internet and a few nice snippets at the Snippet Library.
Snippet Library
LINK: http://dlh-digital.com/Snippet/Welcome.php
LINK: http://www.mysql.com/downloads/connector/net/
It is very easy to use, and there is all sorts of example code snippets all over the internet and a few nice snippets at the Snippet Library.
Snippet Library
LINK: http://dlh-digital.com/Snippet/Welcome.php
How is PDO more secure?
Last edited by mandai on Thu May 10, 2012 6:29 pm, edited 1 time in total.
The easiest way for me is just ftp and filezilla to also make forums with phpbb there is site that already got mysql built in and you can just make one for w/e the site is: Byethost.com
Insignia wrote:The PHP way of connecting to MySQL.Try with: $db = mysql_connect("mysql server", "databasename", "username", "password")
Code: Select allHave Fun<?php $db = mysql_connect("mysql server", "username", "password") or die("Cannot connect to: " . mysql_error()); echo "Succesfully connected to the MySQL Database"; mysql_close($db); ?>
mandai wrote:How is PDO more secure than the MySQL connector?PDO prevents MySQL Injections with the prepared statements and its faster with the queryes!!
6 posts
Page 1 of 1
Copyright Information
Copyright © Codenstuff.com 2020 - 2023