Database

Some definitions of foreign key:- A FOREIGN KEY in one table points to a PRIMARY KEY in another table. A foreign key is a field in a relational table that matches the primary key of another table. The foreign key can be used to cross-reference tables. A table may have multiple foreign keys, and each foreign key can have a different referenced table. A Foreign Key is a Referential Constraint between two tables. A Referential Constraint or Referential Integrity is a property of data which, when
For using database, you need to install a package of PEAR called ‘MDB2’ along with the installation of PEAR and Smarty. MDB2 provides a common API for all support RDBMS. Connecting to database To connect to a database through PEAR::MDB2, you have to create a valid DSN – data source name. This DSN consists in the following parts: phptype: Database backend used in PHP (i.e. mysql , pgsql etc.) dbsyntax: Database used with regards to SQL syntax etc. protocol: Communication protocol to
Problem: “Fails to start the service. Please wait 30 seconds to try again.” I faced this problem 2 years back when I was a newbie to MySQL. I was just starting to learn PHP and MySQL at that time. [PS: The problem was faced and tackled in Windows platform.] Solution: Well, there is my.ini file to control the server. It might be in your C:/Documents and Settings/Administrator/WINDOWS/my.ini [I suppose that your Operating System is installed in C: drive] Here, “Administrator” is the
In this article, I will be showing you how you can replace string, div content, and image src value with jQuery. You can do this by replace() function in jQuery. View Demo || Download Code Here is the code to replace string. This will replace the ‘smile’ text with ‘be happy’. var oldText = "Save Earth and smile!"; var newText = oldText.replace("smile", "be happy"); Here is the code to replace image src. The following code replaces
The JOIN keyword is used in an SQL statement to query data from two or more tables, based on a relationship between certain columns in these tables. [@via w3schools] A SQL JOIN clause combines records from two or more tables in a database. It creates a set that can be saved as a table or used as is. A JOIN is a means for combining fields from two tables by using values common to each. ANSI standard SQL specifies four types of JOINs: INNER, OUTER, LEFT, and RIGHT. In special cases, a table (base
1) To make a backup of a single MySQL database You have to make backup before you enter inside your MySQL system i.e. by typing mysql –u username –p password . (Here, username and password indicates your MySQL server username and password.) Hence, go to your MySQL root path. Type “mysqldump –u username –p password database_name > backup.sql” (without quote) Here, database_name is the name of the database of which you want to create backup and backup.sql is the backup file name.
It’s very easy to print array and object with jQuery. You can do it with jQuery.each() function. The jQuery.each() function can be used to iterate over any collection, whether it is a map (JavaScript object) or an array. Here is the javascript code to print array or object: jQuery(document).ready(function(){ var arr = [ "earth", "mars", "jupiter", "saturn", "venus" ]; var obj = { one:"earth", two:"mars",