answersLogoWhite

0

To update/delete data from a session all you need to do is the following:

<?php

// to update the session, you just overwrite it like a normal variable

$_SESSION['name'] = "Pizza";

// to delete a sessions data you can do this

$_SESSION['name'] = "";

?>

User Avatar

Wiki User

15y ago

What else can I help you with?

Related Questions

How do you delete data from a MySQL database using PHP?

To delete data from your MySQL database you need to use the mysql_query() function. Please see the example below: &lt;?php mysql_query("DELETE FROM table_name WHERE field_name = 44"); ?&gt;


How do you update data in a MySQL database using PHP?

To update data from your MySQL database you need to use the mysql_query() function. Please see the example below: &lt;?php mysql_query("UPDATE table_name SET field_name_2 = '77' WHERE field_name = 44"); ?&gt;


How do you use sessions in PHP?

Sessions in PHP are easy to learn and set up, first of all you need to make sure you use the function session_start() at the start of each script to make sure the sessions work. Then all you need to do is the following to store information in sessions: &lt;?php // allow sessions to work on script session_start(); // set up a session called my number $_SESSION['my_number'] = 1; ?&gt; That's all you need to do to set up and store data in a session. Now if you want to delete a session you will need to use the unset() function like shown below: &lt;?php unset($_SESSION['my_number']); ?&gt; To destroy all sessions in one go you can call the session_destroy() function. This will save you some time. &lt;?php session_destroy(); ?&gt;


What is the purpose of a PHP session?

A PHP session serves quite a few purposes. PHP sessions store data that the web application developer would like to have preserved across the different page loads.


How do I get rid of PHP in Charter's home page?

Open the PHP script and delete the PHP from it.


How do you insertupdate and delete queries in a one form by using php?

It is not possible for an html form to do 4 simultaneous process. What you need to do is create 4 html forms for insert, update, delete, show data on same php page. Use if...elseif....else statements to load alternative forms on the same page and process them according to user input. User doesn't know there are 4 separate forms. Use &lt;?php $_SERVER['PHP_SELF']; ?&gt; to process form &amp; output other forms on same page.


How do you delete duplicate records in a MySQL database using PHP?

MySQL has three methods for removing duplicate records. Using Delete Join, remove duplicate records. In MySQL, we may utilise the DELETE JOIN query to swiftly eliminate duplicate records Using the ROW NUMBER() function, delete duplicate records. USE THE INTERMEDIATE TABLE TO DELETE DUPLICATE ROWS. To learn more about data science please visit- Learnbay.co


How does Apache MySQL and PHP work together?

Let me answer from less 'technicall' point of view. Apache is the HTTP server. It gets the HTTP requests and answers with the HTML code. PHP is used to generate this HTML dynamically on server side. MySQL is used by PHP for getting the data. Once the Apache HTTP server gets the request for the page with php (or php3, php4, phtml or whatever is configured in Apache's config file), it calls PHP interpreter to generate HTML. Then this HTML is returned to the client - internet browser which sent HTTP request. PHP has got an access to MySQL DB via several APIs. This simply means, that you can just call some function in PHP script to select, import update or delete some data in a table of DB. You can also maintain the DB, create, delete new tables a.s.o. There is a lot of functions for that ;)


How do you make a blog using PHP and MySQL?

You can create blog in php. In fact, many blogs on the internet created using php. There are many readymade blogs which you can install on your own server. Or, if you wish, you can create your own blog application. Simply, blog is a dynamic website (users can add, delete, update content) and PHP was designed for creation of dynamic websites.


Can you help me improve my SEO and update my website using PHP?

There are a few things that you can do to improve SEO and update the website using PHP. You can do steps to step things to the tools.


How you can change data type in PHPwrite a script in PHP that change the string data type in numeric data type?

If you will read typecasting on php, you will know more on this. &lt;?php $str = "10"; $num = (int)$str; ?&gt;


How does you create a delete button in PHP using Dreamweaver?

That question doesn't make much sense...delete for what?