Terminé

PDO if statement

Here is the code. If there are not records /result I want it to say "No Records Were Found" otherwise the results will show.

I have been working with this for a couple of hours and for some reason I just can not get it to work if a PHP if statement...

<?php

$log_id = $result['log_id'];

$query = "SELECT * FROM calls_for_service WHERE log_id = :log_id ";

$stmt = $handler->prepare($query);

$stmt->bindParam(':log_id', $log_id, PDO::PARAM_INT);

$stmt->execute();

$result = $stmt->fetchAll();

foreach ( $result as $row ) {

?>

<div class="container" style="background-color: #ffffff;">

<div class="row" align="left" style="color:black;">

<br>

<div class="col-sm-2">

<font size="2"><strong> Case # &nbsp; </strong></font>

</div>

<div class="col-sm-1">

<font size="2"><strong>Call Time &nbsp; </strong></font>

</div>

<div class="col-sm-1">

<font size="2"><strong> Arrival &nbsp; </strong></font>

</div>

<div class="col-sm-1">

<font size="2"><strong> In Service &nbsp; </strong></font>

</div>

<div class="col-sm-5">

<font size="2"><strong> Actions &nbsp; </strong></font>

</div>

<div class="col-sm-1">

<font size="2"><strong> Edit &nbsp; </strong></font>

</div>

<div align="center" class="col-sm-1">

<font size="2"><strong> Delete &nbsp; </strong></font>

</div>

</div>

<br>

</div>

<div class="container" style="background-color: #ffffff;">

<div align="left" class="row">

<div class="col-sm-2">

<em><font color="#008080"><?php echo $row['case_number']; ?></font></em>

</div>

<div class="col-sm-1">

<em><font color="#008080"><?php echo $row['time_of_call']; ?></font></em>

</div>

<div class="col-sm-1">

<em><font color="#008080"><?php echo $row['time_of_arrival']; ?></font></em>

</div>

<div class="col-sm-1">

<em><font color="#008080"><?php echo $row['time_in_service']; ?></font></em>

</div>

<div class="col-sm-5">

<em><font color="#008080"><?php echo $row['action']; ?></font></em>

</div>

<div class="col-sm-1">

<a href="call_for_service/[login to view URL]<?php echo $row['call_id']; ?>"><em><font color="#990000">Edit</font></em></a>

</a>

</div>

<div class="col-sm-1">

<a href="call_for_service/[login to view URL]<?php echo $row['call_id']; ?>"><em><font color="#990000">Delete</font></em></a>

</div>

</div>

<br>

</div>

<?php

}

?>

<br><br>

Compétences : MySQL, PHP

en voir plus : pdo placeholders, php pdo sqlite prepared statement, what does pdo prepare do, pdo prepare not working, pdo update prepared statement, pdo :: attr_cursor, laravel pdo prepare, pdo prepare, int call, prepare final account statement, prepare financial statement ngo, prepare cash flow statement peachtree, prepare financial statement analysis report wal mart, call method prepare undefined arp3data pl, call method prepare undefined arp3data pl line, call center jobs for filipino in dubai, call center jobs for filipino in uk, call center or telemarketing job in australia for filipinos, a filipino call center phone number, call center business process outsourcing in mumbai

Concernant l'employeur :
( 47 commentaires ) Port Charlotte, United States

Nº du projet : #18525295

Décerné à:

soshiv

HI, i can help you here. Please come over chat and discuss in details. Thanks. ................................................

%selectedBids___i_sum_sub_4% %project_currencyDetails_sign_sub_5% USD en 1 jour
(33 Commentaires)
5.1

10 freelance font une offre moyenne de $19 pour ce travail

rajeshsonisl

Hi there, Quick and easy. Consider it done in the next 5 minutes. Seriously! I have a 99% project completion rate and a 4.99 reputation (out of max 5.0!) from more than 1150 projects from a period of 12 years. Plus

%bids___i_sum_sub_35% %project_currencyDetails_sign_sub_36% USD en 0 jours
(961 Commentaires)
8.7
uhjk

Hello, if you award my bid I can send you code which displays "no records" etc. I can do it in 15 min.

%bids___i_sum_sub_32% %project_currencyDetails_sign_sub_33% USD en 1 jour
(807 Commentaires)
8.2
saagark22

Hi, I can show "no records found" message when no records from database are fetched. I am certain I can do it.

%bids___i_sum_sub_32% %project_currencyDetails_sign_sub_33% USD en 1 jour
(370 Commentaires)
7.2
brightstar928

⭐⭐⭐⭐⭐⭐⭐⭐⭐⭐ Hi I read your job description carefully and I can do your job perfectly. I have developed many websites So I can know what you mean and I am ready for you now. If you hire me, I will finish your job A Plus

%bids___i_sum_sub_32% %project_currencyDetails_sign_sub_33% USD en 1 jour
(38 Commentaires)
6.1
sinaalawighahwer

Hello I have 15 years expert on php programming I'm ready to do your job as soon as possible without any problem. kind regards

%bids___i_sum_sub_32% %project_currencyDetails_sign_sub_33% USD en 1 jour
(6 Commentaires)
3.6
sifisolutions

We Believe in Delivering Perfect Work and Providing Full Satisfaction to Our Client . We also Insure to Deliver the Work in the given Time Frame . we have highly Qualified Professionals in our team. Expertise in P Plus

%bids___i_sum_sub_35% %project_currencyDetails_sign_sub_36% USD en 0 jours
(15 Commentaires)
3.7
mainHELIOS

⭐⭐⭐⭐⭐⭐⭐ IN 1 HOUR I CAN DO IT FOR YOU WITH 100% quality work. I will help you with the code understanding and any question you have I will answer fully. I know your fault. I already fixed similar problem. I can Plus

%bids___i_sum_sub_35% %project_currencyDetails_sign_sub_36% USD en 0 jours
(5 Commentaires)
3.6
santiagoguzmn

sure, inbox me and i can do it, today if u want, using motor in real time to see whats ur error, so write me

%bids___i_sum_sub_35% %project_currencyDetails_sign_sub_36% USD en 0 jours
(0 Commentaires)
0.0
Technerdspk

I can do it if u give me chance i ll never let u down i need reviews here i ll provide u work with full satisfication and perfection

%bids___i_sum_sub_32% %project_currencyDetails_sign_sub_33% USD en 1 jour
(0 Commentaires)
0.0