True/False in PHPmyadmin [closed] - php

Closed. This question needs details or clarity. It is not currently accepting answers.
Want to improve this question? Add details and clarify the problem by editing this post.
Closed 7 years ago.
Improve this question
Can someone help me how to change the bool type in phpmyadmin(interface).
e.g.
If you click button number 1, it says true and if you click button number 2 it says false.

You have to make an update statement like Eda said. To clarify, if the table is called Test and the column is called Information, the statement would read:
UPDATE Test.Information SET value = b'1'

Like this:
UPDATE `table`.`col` SET `value` = b'1';

Related

how do I get just one value from mysql php query results [closed]

Closed. This question needs details or clarity. It is not currently accepting answers.
Want to improve this question? Add details and clarify the problem by editing this post.
Closed 1 year ago.
Improve this question
Below are the results of my query. I would just like to return the refundable_amount value. Which for this query $4.04
a:1:{i:0;a:19:{s:8:"label_id";i:3324543;s:8:"tracking";s:22:"9400136205309684548265";s:17:**"refundable_amount";d:4.04**;s:7:"created";i:1614781854687;s:10:"carrier_id";s:4:"usps";s:12:"service_name";s:23:"USPS - First Class Mail";s:6:"status";s:9:"PURCHASED";s:22:"commercial_invoice_url";N;s:12:"package_name";s:11:"Single Kcup";s:9:"is_letter";b:0;s:13:"product_names";a:1:{i:0;s:28:"Multiple Aware";}s:11:"product_ids";a:1:{i:0;i:1212;}s:15:"receipt_item_id";i:72845982;s:12:"created_date";i:1614781859000;s:11:"expiry_date";i:1630333858000;s:15:"main_receipt_id";i:54663164;s:4:"rate";d:4.04;s:8:"currency";s:3:"USD";s:12:"label_cached";i:1614781863000;}}
Thank you in advance for any help.
You have typo, in near the "Multiple Aware" output, it should be 14, if you correct it like below,
Then you can use php unserialize function
$text = unserialize ('a:1:{i:0;a:19:{s:8:"label_id";i:3324543;s:8:"tracking";s:22:"9400136205309684548265";s:17:"refundable_amount";d:4.04;s:7:"created";i:1614781854687;s:10:"carrier_id";s:4:"usps";s:12:"service_name";s:23:"USPS - First Class Mail";s:6:"status";s:9:"PURCHASED";s:22:"commercial_invoice_url";N;s:12:"package_name";s:11:"Single Kcup";s:9:"is_letter";b:0;s:13:"product_names";a:1:{i:0;s:14:"Multiple Aware";}s:11:"product_ids";a:1:{i:0;i:1212;}s:15:"receipt_item_id";i:72845982;s:12:"created_date";i:1614781859000;s:11:"expiry_date";i:1630333858000;s:15:"main_receipt_id";i:54663164;s:4:"rate";d:4.04;s:8:"currency";s:3:"USD";s:12:"label_cached";i:1614781863000;}}');
you can get the value as below,
echo $text[0]['rate'];
will output
4.04
For more information about this function you can visit
https://www.php.net/manual/en/function.unserialize.php

mysql update data entry in column without removing previous data [closed]

Closed. This question needs to be more focused. It is not currently accepting answers.
Want to improve this question? Update the question so it focuses on one problem only by editing this post.
Closed 2 years ago.
Improve this question
What I'm trying to achieve is whenever this column is updated, it shouldn't remove the previous data that has been filled, instead, it should just enter data in the next line with the previous data too.
For example
Author 1
Author 2
This is my code
$booktb = $db->update("books", "author" => $author);
I've looked into this question but it didn't work for me
Update data in mysql column field without removing previous value
pseudo code
$b = $db->select("books","author" => "kafka");
$b["title"] = "another book"
$db->insert("books",$b);

Get $_GET value [closed]

Closed. This question needs details or clarity. It is not currently accepting answers.
Want to improve this question? Add details and clarify the problem by editing this post.
Closed 7 years ago.
Improve this question
I am trying to make a simple PHP program. I am trying to get the value from the URL and check if the dev is equal to true. I am using this code:
if($_GET['dev']==true){...}else if($_GET['dev']==false){...}
$_GET variable are all strings, you will need to cast it to a boolean
if (isset($_GET['dev']))
{
$dev= (bool) $_GET['dev'];
if($dev){
}
}
details are not enough, tell us more about your problem.
maybe you need to compare dev to a string and not to boolean:
if($_GET['dev']=="true"){...}else if($_GET['dev']=="false"){...}

Is it possible to delete data from webpage but do not delete from database? [closed]

Closed. This question needs details or clarity. It is not currently accepting answers.
Want to improve this question? Add details and clarify the problem by editing this post.
Closed 8 years ago.
Improve this question
I wish to know that whether is there any possible that can allow me to delete or hide the data on my php website but when I go inside my database, the record that is being deleted will still store inside the original database?
You have to add a deleted flag to your table
For deleting you set the flag:
UPDATE table SET deleted=1 WHERE id=xy
For geting the data from the database you have to check the flag:
SELECT * FROM table WHERE deleted=0

Calling a field from database in MySQL [closed]

Closed. This question needs details or clarity. It is not currently accepting answers.
Want to improve this question? Add details and clarify the problem by editing this post.
Closed 9 years ago.
Improve this question
return(array($clientName,$salesPer,$prospectVal,$projID));
The projectID is dynamically added in database for each entry, now how can i return the ID. As i have not set any variable in PHP to map the database field.
Can anyone guide me on this.
If you're asking how to get back the ProjectID after it has been inserted into the database and automatically assigned, I suggest using something like the following:
$projID = mysql_insert_id();
immediately after running the insert statement.

Categories