the result of query mysql output "if exists" in store procedure with "select exist" is different

I want to check if this record is already on the list. l have 3 query. 1 procedure "if exists". 1 procedure "if (select count(*) from tbl ) > 0". 1 "select exists()". but 2 procedures have the same result. different from the "select exists" query query procedure "if exists" CREATE DEFINER=`admin`@`localhost` PROCEDURE `ins_upd_price_cust`(IN buyerid2… Read More the result of query mysql output "if exists" in store procedure with "select exist" is different

Want to show date counter

I want to make date counter in following codes. the format must be today’s date – previous date. I tried to add but I think the format is wrong. Can you guys please check? if (mysqli_num_rows($result) > 0) { $row = mysqli_fetch_array($result); $curr_dt = DateTime::createFromFormat("Y-m-d H:i:s", date("Y-m-d") . " 00:00:00"); $row_dt = DateTime::createFromFormat("Y-m-d H:i:s", $row["dt_corr"]);… Read More Want to show date counter

foreach() argument must be of type array|object, bool given. How can i join another table where a where clause also must be there.?

$SQL = "SELECT * FROM note_list JOIN `notemaker_tables` ON note_list.notemaker_id=notemaker_tables.notemaker_id WHERE notemaker_id = ‘$notemaker_id’;"; $result = $con->query($SQL); ?> <?php <!– Featured Project Row–> <h1 class="text-white">Notes By <?php echo $notemaker_id; ?></h1><br> <?php foreach ($result as $r) { ?> <div class="row align-items-center no-gutters mb-4 mb-lg-5"> <div class="col-xl-8 col-lg-7"> <iframe id="pdf-js-viewer" src="dashboard/note-pdf/<?php echo $r[‘note’]; ?>" title="webviewer" frameborder="0" width="500"… Read More foreach() argument must be of type array|object, bool given. How can i join another table where a where clause also must be there.?

Display last, 2nd last and 3rd last value from a database and display in a specific order

Assume i have the following in my database, db connection established: A user form that has and input enter product with a submit button, which inserts into the database. id and product, with a table named table. Filled with information. Then i select the last id by doing the following: $results = mysqli_query($con, "SELECT *… Read More Display last, 2nd last and 3rd last value from a database and display in a specific order