Tuesday, November 19, 2024

Generate Even Numbers in a Range In PHP.

$start = 1;

$end = 20;


for ($i = $start; $i <= $end; $i++) {

    if ($i % 2 == 0) {

        echo $i . " is even.<br>";

    }

}


Monday, November 18, 2024

Check if a Number is Even In PHP.

 $number = 4;


if ($number % 2 == 0) {

    echo "$number is an even number.";

} else {

    echo "$number is not an even number.";

}


Monday, August 15, 2022

Update Records Into Tables Using SQL Join Query

 this query is used for update record into tables with join and where query which update all matching records.

UPDATE `product`

inner join `category` on `category`.`id` = `product`.`category_id` and `category`.`deleted_at` IS NULL

 SET `product`.`category_id` = category.id WHERE `product`.`deleted_at` IS NULL AND `id` = '1'

How To install PHP 7.0 Into Ubuntu And Its Maths Functions Using CMD

 this commands is used for install php 7.0 with cmd and various type of maths function 

sudo apt install -y php7.0

sudo apt install -y php7.0-cli php7.0-fpm php7.0-common php7.0-json php7.0-opcache php7.0-mysql php7.0-phpdbg php7.0-mbstring php7.0-gd php7.0-pgsql php7.0-intl php7.0-curl php7.0-zip php7.0-xml php7.0-mcrypt php7.0-sqlite3 php7.0-xmlrpc php7.0-xsl

sudo sed -i  "s#user = www-data#user = username#"  /etc/php/7.0/fpm/pool.d/www.conf

sudo sed -i  "s#group = www-data#group = username#"  /etc/php/7.0/fpm/pool.d/www.conf

sudo sed -i  "s#;cgi.fix_pathinfo=1#cgi.fix_pathinfo=0#"  /etc/php/7.0/fpm/php.ini

sudo service php7.0-fpm restart

Saurashtra University Old Exam Papers for Andorid

How To Count Duplicate Records Using SQL Query.

SELECT count_id, COUNT(count_id)

FROM select_table_name

where where_id > 1 and

GROUP BY count_id

HAVING COUNT(count_id) > 1

Wednesday, May 30, 2018

Create Program Using MySQLi & PHP To Insert, Select, Update, Delete In MySQL Database Table.

This tutorial will help you that how to perform  insertupdate and delete operations using PHP & MySQLiusing short functions and so low code.



I have create on insert.php file and i have all the program code write in this single file 


insert.php

following are the my php and html code:




<?php 
include "db.php";

if(isset($_POST['submit']) && $_POST['action'] == "add"){
extract($_POST);
$que = $con->query("insert into student(stud_name,email,password) values('$nm','$email','$pass')");
if($que){header('location:insert.php');exit();}
else{ echo "not added";}
}

if(isset($_GET['delete'])){
$del_res= $con->query("delete from student where id =".$_GET['delete']);
header('location:insert.php');
exit();
}

if(isset($_GET['edit'])){
$get_rec = $con->query('select * from  student where id='.$_GET['edit'])->fetch_assoc();
//print_r($get_rec);
}

if(isset($_POST['submit']) && $_POST['action'] == "edit"){
extract($_POST);
$que = $con->query("update student set stud_name = '$nm',email='$email',password='$pass' WHERE id=".$_GET['edit']);
header('location:insert.php');
exit();
}

$result = $con->query("select * from student");
?>
<html>
  <body>
    <form action="" method="post">
<div>name :<input type="text" name="nm" value="<?= (isset($get_rec['stud_name'])) ? $get_rec['stud_name'] : ''; ?>"></div>
<div>email :<input type="email" name="email" value="<?= (isset($get_rec['email'])) ? $get_rec['email'] : ''; ?>"> </div>
    <div>password :<input type="password" name="pass" value="<?= (isset($get_rec['password'])) ? $get_rec['password'] : ''; ?>"></div>
<div>
<input type="hidden" name="action" value="<?= isset($_GET['edit']) ? "edit":"add" ?>">
<input type="submit" name="submit">
<input type="reset" name="reset">
</div>
</form>
<table border='1' cellpadding='10' cellspacing='0'>
<tr>
<th>NO</th>
<th>Name</th>
<th>email</th>
<th>password</th>
<th>action</th>
</tr>
   <?php
$i=1;
while($row = $result->fetch_assoc())
{
  ?>
<tr>
<td><?php echo $i; ?></td>
<td><?= $row['stud_name']; ?></td>
<td><?php echo $row['email']; ?></td>
<td><?php echo $row['password']; ?></td>
<td><a href="insert.php?delete=<?php echo $row["id"] ;?>">Delete</a> | <a href="insert.php?edit=<?php echo $row["id"] ;?>">EDIT</a></td>
</tr>
  <?php
$i++;
}
   ?>
</table>
  </body>
</html>





Thursday, April 26, 2018

What Is Layout In Android

XML-Based Layouts in Android. In Android, an XML-based layout is a file that defines the different widgets to be used in the UI and the relations between those widgets and their containers


Download PPT Here

Tuesday, April 24, 2018

What Is API In Android

There are many types of APIs. One of the most common types of APIs are Web APIs; these APIs, otherwise known as Web Services, provide an interface for web applications, or applications that need to connect to each other via the Internet to communicate.




Download PPT Here

Sunday, April 22, 2018

What is manifest file in android?


Every application must have an AndroidManifest.xml file (with precisely that name) in its root directory. The manifest presents essential information about the application to the Android system, information the system must have before it can run any of the application's code.


Download PPT Here

What Is Domain Name System And IP-Bench Marking In SQL Server

this PPT is about what is domain name system and ip bench marking in sql server 



Download PPT Here

Friday, April 20, 2018

Sunday, April 15, 2018

What Is Architectural Component Of Data ware House And Data mining

This PPT Is About What Is Architectural Component Of The Data Warehouse And Data mining.

Into This PPT All Brief Description About Architectural Component Are Given.


Download PPT Here 

Friday, April 13, 2018

What Is Location Based Service In Android

This PPT Is About What Is Location Based Service In Android.

In This PPT Brief Description About Location Based Service Given.

Download PPT Here 

Generate Even Numbers in a Range In PHP.

$start = 1; $end = 20; for ($i = $start; $i <= $end; $i++) {     if ($i % 2 == 0) {         echo $i . " is even.<br>";   ...