Posts

Showing posts with the label #sbphptricks

How to select data from mysql database using PHP

Image
In this tutorial we will learn how to select data from mysql database.First of all we need to connect to the database from which we will collect data.            $con=mysqli_connect("localhost","root","","youtube"); In the above code the root is the username of the mysql and the database name is "youtube".You can replace your database name in this portion.Now we will select data from database using select sql.        $query="select * from registration"; Here the table name is registration,the structure of the table is as follows:- Column Name Type rid int(11) name varchar(100) fathersname varchar(100) mothersname varchar(100) address varchar(200) email varchar(200) uname varchar(200),Primary Key password varchar(200) In the next step we will execute the query ,after execution we will get a result set.Now we will supply that result set to also mysqli_fetch_row(),which will fetch the rows fr...

Login Using Android

Image
In this tutorial you will learn to do login using Android studio.In this tutorial back end is developed using PHP and database is Mysql.In this tutorial volley is used as library. Lets check the code step by step. First Lets check the .XML code ,which we also discussed in the tutorial of " Simple Login App Design Using Android Studio ". The code is very simple ,here we are using Constrain layout and Relative layout . The code is as follows:- <?xml version="1.0" encoding="utf-8"?> <androidx.constraintlayout.widget.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android"   xmlns:app="http://schemas.android.com/apk/res-auto"    xmlns:tools="http://schemas.android.com/tools"   android:layout_width="match_parent"   android:layout_height="match_parent"    tools:context=".MainActivity">     <ImageView      android:id="@+id/i...

Random password Generator In PHP

Image
In this tutorial you will learn how to create a random password using PHP. This program can be helpful to suggest the users an auto generated random password.In this program we are using substr() method which will use str_shuffle() to create a password of the length which is supplied to the function pass1($len).The password length will be decided by the number which is supplied to the function.The code of the program is as below- <?php function pass1($len) { error_reporting(0); $charset="!@iloveindia%^&"; $password=substr(str_shuffle($charset),0,$len); return $password; } $newpassword=pass1(8); ?> <table> <tr> <td>Password</td> <td><?php echo $newpassword;?></td> <td><input type="button" name="b1" id="b1" value="New Password" onClick="window.location.reload()"/></td> </tr> </table> Copy this code and paste in your .php file...