Insert API/Webservice Using PHP-MYSQL

We will need to create 2 files. One file would contain the insertion form. 1.Create a form called “signup.php” and put the following code into it. <html> <body> <h1><b>INSERT INQUIRY DETAILS</b></h1> <form method=”POST” action=”your/file/path/filename.php”> <table><tr><td> FIRST NAME:</td><td><input type=”text” name=”first_name” required></td></tr><tr><td> LAST NAME:</td><td><input type=”text” name=”last_name” required></td></tr><tr><td> PHONE:</td><td><input type=”text” name=”phone” required></td></tr><tr><td> EMAIL:</td><td><input type=”text” name=”email” required></td></tr> <tr><td> POSTAL CODE:</td><td><input […]

Read More

Size of all the databases:PHPMYADMIN

How to know the size of the databases of PHPMyAdmin? I have written a simple to list the size of all the databases using PHP Script. Following is the code to know the size of all the databases. <?php echo “<h3><b>Size of all databases</b></h3>”; echo “<br>”; $servername = “localhost”; //replace with your hostname $username = […]

Read More

Create a query box same as PHP-MyAdmin

Hello everyone, Once I had a task to create a query-box, which is similar to phpmyadmin SQL tab. Following the code which I wrote for it. It is very useful in the cases where you know the data structure and you don’t want to open cpanel again and again to check the code. /* 1. Create […]

Read More

Create Simple API using Angular JS and MySQL

API: Angular JS+Mysql 1. Create an api file.(student_name.php) 2. Create a file which would retrieve data from the database.(information_source_sql.php) /* Keep following angularjs code in student_name.php */ <!DOCTYPE html> <html > <style> table, th , td  { border: 1px solid grey; border-collapse: collapse; padding: 5px; } table tr:nth-child(odd) { background-color: #f1f1f1; } table tr:nth-child(even) { […]

Read More

Connect More Than One Database:PHP

Connect more than 1 database //write your database credentails $servername = “localhost”; $username = “root”; $password = “”; //your connection code would be as follows: $dbh1 = mysql_connect($servername, $username, $password); $dbh2 = mysql_connect($servername, $username, $password,true); $dbh3 = mysql_connect($servername, $username, $password,true); //replace db1,db2,db3 with your database name mysql_select_db(‘db1’, $dbh1); mysql_select_db(‘db2’, $dbh2);mysql_select_db(‘db3’, $dbh3); //USING UNION:DISPLAY DATA FROM […]

Read More