Search
 
SCRIPT & CODE EXAMPLE
 

PHP

update sql php

$query = "UPDATE `$table` SET column1 = '$value1', column2 = '$value2' WHERE $condition;"; 
Comment

sql update row in php

mysql_query("UPDATE blogEntry SET content = '$udcontent', title = '$udtitle' WHERE id = $id");
Comment

Updating records in PHP

<?php
include_once 'database.php';
if(count($_POST)>0) {
mysqli_query($conn,"UPDATE employee set userid='" . $_POST['userid'] . "', first_name='" . $_POST['first_name'] . "', last_name='" . $_POST['last_name'] . "', city_name='" . $_POST['city_name'] . "' ,email='" . $_POST['email'] . "' WHERE userid='" . $_POST['userid'] . "'");
$message = "Record Modified Successfully";
}
$result = mysqli_query($conn,"SELECT * FROM employee WHERE userid='" . $_GET['userid'] . "'");
$row= mysqli_fetch_array($result);
?>
<html>
<head>
<title>Update Employee Data</title>
</head>
<body>
<form name="frmUser" method="post" action="">
<div><?php if(isset($message)) { echo $message; } ?>
</div>
<div style="padding-bottom:5px;">
<a href="retrieve.php">Employee List</a>
</div>
Username: <br>
<input type="hidden" name="userid" class="txtField" value="<?php echo $row['userid']; ?>">
<input type="text" name="userid"  value="<?php echo $row['userid']; ?>">
<br>
First Name: <br>
<input type="text" name="first_name" class="txtField" value="<?php echo $row['first_name']; ?>">
<br>
Last Name :<br>
<input type="text" name="last_name" class="txtField" value="<?php echo $row['last_name']; ?>">
<br>
City:<br>
<input type="text" name="city_name" class="txtField" value="<?php echo $row['city_name']; ?>">
<br>
Email:<br>
<input type="text" name="email" class="txtField" value="<?php echo $row['email']; ?>">
<br>
<input type="submit" name="submit" value="Submit" class="buttom">

</form>
</body>
</html>
Comment

update php

STEP 1:
If you want to update your php version.
Then go to php offical site https://www.php.net download your desire version from there.

STEP 2:
A zip file will be download, extract it.

STEP 3:
Then put it into your apache local server like (Xampp, Laragon, Wampp etc) in php folder.

STEP 4:
a) goto search bar of the window
b) search "environment variables"
c) goto "Enivronment Variables..."
d) In System Variables got "path" variable
e) Add your php folder path that you added before in apache local serve


NOTE !
If you are using multiple php versions at a time 
then make sure that version you want use keep that version path at the top or first from other php versions 

Boom!!!!!!

It's DONE.
Comment

PREVIOUS NEXT
Code Example
Php :: migrate specific migration file laravel 
Php :: delete file in php 
Php :: convert single quote in htmlentities php 
Php :: php json_encode utf8 
Php :: rule In in laravel 
Php :: Type cast using double php 
Php :: php laravel between dates 
Php :: php variable in string 
Php :: laravel observer check if field changed 
Php :: laravel composite unique key 
Php :: php string slice 
Php :: How to write a loop in PHP 
Php :: how to get last id in database codeigniter 4 
Php :: php function comment 
Php :: hide env file in laravel 
Php :: pdf to html php 
Php :: add item to array in php 
Php :: php imagick xampp windows 
Php :: php get post json data 
Php :: how to assign value of a js variable to a php variable 
Php :: laravel validation decimal 
Php :: laravel tree category 
Php :: php even odd program 
Php :: update laravel .env variables dynamically 
Php :: convert an integer to a string in PHP 
Php :: PHP MySQL Delete Data 
Php :: wordpress get post featured image 
Php :: laravel order by numbers 
Php :: laravel collection remove empty 
Php :: php replace youtube embed url 
ADD CONTENT
Topic
Content
Source link
Name
7+3 =