PHP Notes By Kshitij :: PART 9

Share this…Facebook0TwitterLinkedinPrint Post Views: 482 Database connectivity with form mysql_connect(host, user, password) It accepts hostname, username, password and returns true if connection successfully otherwise returns empty string.   mysql_select_db(“databasename”) It opens database. If opens successfully returns true otherwise empty string.   mysql_query(“query”) it executes Query. It returns true if executes DML query […]

PHP Notes By Kshitij :: PART 8

Share this…Facebook0TwitterLinkedinPrint Post Views: 571 Structured Query Language ( SQL ) Create Database : college 1) Create Table : students Fields : id(int, auto increment, primary key, starts from 1) fname (varchar 30) lname (varchar 30) city (varchar 20) dob (date) gender (enum – “Male”, “Female”)   2) Create Table : course Fields : […]

PHP Notes By Kshitij :: PART 7

Share this…Facebook0TwitterLinkedinPrint Post Views: 439   Form in PHP (Registration.php) <html> <head> <title>Registration Form</title> </head>   <body> <form action=”process.php” method=”get”> <table border=”2px” align=”center”> <tr> <th>User Name</th> <td><input type=”text” name=”uname”/></td> </tr> <tr> <th>Password</th> <td><input type=”password” name=”password”/></td> </tr> <tr> <th>Address</th> <td><textarea name=”address”></textarea></td> </tr> <tr> <th>City</th> <td> <select name=”city”> <option value=””>— Select City —</option> <option value=”Ajmer”>Ajmer</option> <option value=”Jaipur”>Jaipur</option> […]

PHP Notes By Kshitij :: PART 6

Share this…Facebook0TwitterLinkedinPrint Post Views: 452 PHP Library Functions String Functions   Here Doc Operator For String And Methods <<< Heredoc Operator: used for storing long string. <?php   $msg=<<<abc Hello All ‘We lcome’ to “iBirds” and See Its a “String”, <br> ‘Single’ and “Double”; Shastri Nagar, Ajmer abc; echo $msg; //exit; //die(“Bye”); ?>   strlen(String): […]

PHP Notes By Kshitij :: PART 5

Share this…Facebook0TwitterLinkedinPrint Post Views: 479 Functions: A function is a block of statements that can be used repeatedly in a program. Writing function avoids rewriting the same code over and over. It reduces program size and provides facility to manage and debug the code. A function will not execute immediately when a page loads. A […]