MySQL Archive
-
Connect To Database With mysqli_connect
Posted on 5th Jul 2010 | No CommentsHere’s another way to connect to the databse: // Connect with username, password, etc... $link = mysqli_connect('localhost', 'userName', 'passWord'); if (!$link){ $error = 'Unable to connect to the database server.';... -
Connect To Database With mysql_connect
Posted on 5th Jul 2010 | No CommentsThere are several methods of connecting to a database, here’s one example: // Set the database access information as constraints DEFINE ('DB_USER', 'userName); DEFINE ('DB_PASSWORD', 'passWord'); DEFINE ('DB_HOST', 'localhost'); ... -
Count Rows / Records
Posted on 13th Apr 2010 | No CommentsSimple enough…. $result = mysql_query('SELECT * FROM table1'); $num_rows = mysql_num_rows($result); $num_rows returns the number of records returned by the query…. -
Find and Replace text in whole MySQL database
Posted on 28th Mar 2010 | No CommentsAnother splendid idea from Mark Jackson (MJ Digital). This loops through the database and replaces a certain string with another… Ideal is a site name has been changed…. Or I...



