Fermé

Simple and Small Project in Php

Hello i have a code which is written in mysqli function in PHP but i want to change in param and bind and execute in php look like

$number_filter_row = mysqli_num_rows(mysqli_query($connect, $query));

But i want to change it on

$cpc3 = NULL;

$cpc3 = $_POST["search"]["value"];

$cpc3 = "%$cpc3%";

$cpc3 = "'". $cpc3. "'";

$nrs=$cn->prepare($query);

$nrs->bind_param("sssss",$cpc3,$cpc3,$cpc3,$cpc3,$cpc3);

$nrs->execute();

$nrt = $nrs->get_result();

while($row = $nrt->fetch_assoc())

{

$number_filter_row = $row['row'];

}

ANd all code is here:-

<?php

//[login to view URL]

$connect = mysqli_connect("localhost", "root", "", "test");

$columns = array('meg', 'cpc' ,'os' , 'qa' , 'finance');

$query = "SELECT * FROM user ";

if(isset($_POST["search"]["value"]))

{

$query .= '

WHERE meg LIKE "%'.$_POST["search"]["value"].'%"

OR cpc LIKE "%'.$_POST["search"]["value"].'%"

OR os LIKE "%'.$_POST["search"]["value"].'%"

OR qa LIKE "%'.$_POST["search"]["value"].'%"

OR finance LIKE "%'.$_POST["search"]["value"].'%"

';

}

if(isset($_POST["order"]))

{

$query .= 'ORDER BY '.$columns[$_POST['order']['0']['column']].' '.$_POST['order']['0']['dir'].'

';

}

else

{

$query .= 'ORDER BY id DESC ';

}

$query1 = '';

if($_POST["length"] != -1)

{

$query1 = 'LIMIT ' . $_POST['start'] . ', ' . $_POST['length'];

}

$number_filter_row = mysqli_num_rows(mysqli_query($connect, $query));

print $query

$result = mysqli_query($connect, $query . $query1);

$data = array();

while($row = mysqli_fetch_array($result))

{

$sub_array = array();

$sub_array[] = '<div contenteditable class="update" data-id="'.$row["id"].'" data-column="meg">' . $row["meg"] . '</div>';

$sub_array[] = '<div contenteditable class="update" data-id="'.$row["id"].'" data-column="cpc">' . $row["cpc"] . '</div>';

$sub_array[] = '<div contenteditable class="update" data-id="'.$row["id"].'" data-column="os">' . $row["os"] . '</div>';

$sub_array[] = '<div contenteditable class="update" data-id="'.$row["id"].'" data-column="qa">' . $row["qa"] . '</div>';

$sub_array[] = '<div contenteditable class="update" data-id="'.$row["id"].'" data-column="finance">' . $row["finance"] . '</div>';

$sub_array[] = '<img src="[login to view URL]" id="'.$row["id"].'" class="delete" style="text-align:center">'.'<img src="[login to view URL]" id="'.$row["id"].'" class="edit" style="padding-left:10px;">';

$data[] = $sub_array;

}

function get_all_data($connect)

{

$query = "SELECT * FROM user";

$result = mysqli_query($connect, $query);

return mysqli_num_rows($result);

}

$output = array(

"draw" => intval($_POST["draw"]),

"recordsTotal" => get_all_data($connect),

"recordsFiltered" => $number_filter_row,

"data" => $data

);

echo json_encode($output);

?>

So if anyone can do it then please let lme know

Thanks

Compétences : PHP, MySQL, JavaScript

en voir plus : php projects ideas, php projects free download zip, simple php projects for beginners with source code, php projects with source code and documentation free download, php projects with source code and database free download pdf, php projects for practice, 1000 projects in php free download, php project ideas 2020, simple ajax project php, free small project php update data database, small project php smarty, login logout small project php example, simple flex project php, simple small cms php mysql, idea small project php, money small project php, simple mini project php, simple small project, simple small website php, small project php access database

Concernant l'employeur :
( 0 commentaires ) Delhi, India

Nº du projet : #27961916

6 freelances font une offre moyenne de 1167 ₹ pour ce travail

sandeepohri1

Hello, I have gone through your project description and I can confirm that l am deem fit to deliver it as expected. I am a senior software developer with plenty of experience and creativity. Kindly contact me so that w Plus

%bids___i_sum_sub_32% %project_currencyDetails_sign_sub_33% INR en 1 jour
(22 Commentaires)
4.3
pranavjandu3

I can change your mysqli statements to PDO in PHP. Let's chat to discuss more. I'm a software engineer with specialization in python and PHP.

%bids___i_sum_sub_32% %project_currencyDetails_sign_sub_33% INR en 1 jour
(9 Commentaires)
3.5
sauravmamgain9

i can do this task sir . I assured to you that my work quality ll be always good and ll be available 24*7.

%bids___i_sum_sub_35% %project_currencyDetails_sign_sub_36% INR en 7 jours
(3 Commentaires)
1.3
kamal635

Dear Hiring Manger, As per your details, I am ready for Website Coding. I am a Web expert from last few years and deal with many website. I have more than 6 years of experience in Web Design , Website development Plus

%bids___i_sum_sub_32% %project_currencyDetails_sign_sub_33% INR en 1 jour
(0 Commentaires)
0.0
itskomal

I have carefully read your requirement. I will do this job. I Please come on chat we discuss more. My experience and skills are follows: - Backend Development: Laravel | PHP | Shopify | Wordpress - Frontend Developmen Plus

%bids___i_sum_sub_35% %project_currencyDetails_sign_sub_36% INR en 2 jours
(0 Commentaires)
0.0
Ahmad90Raza

respected sir i have knowledge about the php and can do your project and satisfied you to in project.

%bids___i_sum_sub_35% %project_currencyDetails_sign_sub_36% INR en 2 jours
(0 Commentaires)
0.0