K
K
Kirill2016-01-24 18:27:47
PHP
Kirill, 2016-01-24 18:27:47

Problems with the checkbox?

Hello! How to make a condition:

if (!empty ($row[email5])) {

    echo "<table width=100% height=300 bgcolor=red><tr><td>Привет!</td></tr></table>";
  }

for checkbox
here is update
<?php
require 'connect.php';
$id=$_REQUEST['id'];
$email5=trim($_REQUEST['email5']);
$name_order=trim($_REQUEST['name_order']);
$email_order=trim($_REQUEST['email_order']);
$tel_order=trim($_REQUEST['tel_order']);
$mes_order=trim($_REQUEST['mes_order']);

$update_sql = "UPDATE ordersait SET email5='$email5', name_order='$name_order', email_order='$email_order', tel_order='$tel_order', mes_order='$mes_order' WHERE id='$id'";
mysql_query($update_sql) or die("Ошибка вставки" . mysql_error());
echo '<p>Запись успешно обновлена!</p>';
?>

Please do not suggest other options
, nothing appears for me, everything is fine for text, how to do it for the checkbox?
thanks in advance

Answer the question

In order to leave comments, you need to log in

2 answer(s)
N
Nazar Mokrinsky, 2016-01-24
@nazarpc

Checkbox - you either have it or you don't. It is not visible in your code, so I will give an example:
If it is selected - then:
And if not:
If you just need to check whether it is selected - issetenough.
PS From now on I will demolish both duplicates, ask one question ONCE.
PPS Nobody owes you anything; give hints - study, understand; if you want to be done for you - order on freelance or in other places.

S
Sergey, 2016-01-24
@gangstarcj

You have already asked a question, you have all answered there!!!

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question